Open ile opened 8 years ago
Thanks for the example. I do get a "Failed to get URL" for the first script. However, it appears to be a timeout issue.
If I change the first part of the script to 20 seconds, it seems to work fine.
var Horseman = require('./lib/index'),
horseman = new Horseman({
injectJquery: false,
ignoreSSLErrors: true,
timeout: 20000
});
Right, thanks. Is there a possibility to change the error message to reflect that?
It definitely should. Haven't looked into what's going on under the hood but I will.
Unfortunately the .open
in PhantyomJS simply returns 'success'
or 'fail'
and nothing about why it failed. It order to recognize it was caused by a timeout, horseman needs to register an onResourceTimeout
callback and change its error message there.
I do not know when I will have time to implement this, but perhaps this will help someone else to write a fix.
This gives an error of
Error: Failed to GET url: https://farm9.staticflickr.com/8422/28832766510_900709792b_k_d.jpg
If I use
node-phantom-simple
directly, it seems to work:I haven't tracked the error further, so not 100 % sure it's in Horseman, but so far it seems to be so? And this seems to happen with big files (not sure how big, maybe over 1 MB).