Answer the question
In order to leave comments, you need to log in
How to "ignore" javascript error on page load using PhantomJs?
Using PhantomJs, I am parsing the site page. During page load, PhantomJs loads javascript scripts. During the execution of one of the scripts, an error occurs, and then the required page is not processed correctly and completely.
Everything works fine in the browser, but here is PhantomJs. Maybe someone solved such a problem?
Answer the question
In order to leave comments, you need to log in
If the error itself is not critical, and it is enough to simply ignore it and continue the script execution, then use the try/catch construct.
try {
// код, вызывающий ошибку
} catch(e) {
console.log(e)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question