I have a web crawler and I use phantomjs to parse pages, I want to get the html, but I always get this type of errors in the output before the html code
Ref
The easiest way is to add an error handler to phantom.onerror or webpage.onerror. These callbacks are invoked when there is a JavaScript execution error (in the page or in your script).
page.onError = function(msg, trace) {
var msgStack = ['ERROR: ' + msg];
if (trace && trace.length) {
msgStack.push('TRACE:');
trace.forEach(function(t) {
msgStack.push(' -> ' + t.file + ': ' + t.line + (t.function ? ' (in function "' + t.function + '")' : ''));
});
}
// uncomment to log into the console
// console.error(msgStack.join('\n'));
};