The actual error message is partially hidden down the error output. In the browser.visit function add ...
console.log(err.message);
... higher throw(err.message); . This should give you a better idea of ββwhat is going wrong :)
EDIT: by testing node 0.4.1 / zombie 0.9.1 at www.google.com, it looks like a JavaScript error (ILLEGAL TOKEN) is causing the problem. You can get around JavaScript errors by customizing your zombie code as follows:
browser = new zombie.Browser(); browser.runScripts = false; // this disables executing javascript browser.visit("http://www.google.com/", function (err, browser) { if (err) { console.log('Error:' + err.message); } else { console.log('Page loaded successfully'); } // ... rest of your code here });
Personally, I do not find the current zombie error error very useful, so I prefer to disable it and display a simple console.log message when something goes wrong.
Finally, you can also debug errors by passing the browser function to debug: true :
browser = new zombie.Browser({ debug: true });
This will output all calls (incl. Ajax) and may help determine the source of the error.
Good luck
source share