Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled rejection Error: Failed to GET url #187

Closed
minhchu opened this issue May 27, 2016 · 1 comment
Closed

Unhandled rejection Error: Failed to GET url #187

minhchu opened this issue May 27, 2016 · 1 comment

Comments

@minhchu
Copy link

minhchu commented May 27, 2016

This is the error I got when run node horseman.js:

Unhandled rejection Error: Failed to GET url: https://www.google.com/search?site
=&tbm=isch&source=hp&biw=1366&bih=640&q=moon
    at checkStatus (D:\PhantomJS\node_modules\node-horseman\lib\actions.js:78:16
)
    at PassThroughHandlerContext.finallyHandler (D:\PhantomJS\node_modules\blueb
ird\js\release\finally.js:56:23)
    at PassThroughHandlerContext.tryCatcher (D:\PhantomJS\node_modules\bluebird\
js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\PhantomJS\node_modules\bluebird\js\
release\promise.js:502:31)
    at Promise._settlePromise (D:\PhantomJS\node_modules\bluebird\js\release\pro
mise.js:559:18)
    at Promise._settlePromise0 (D:\PhantomJS\node_modules\bluebird\js\release\pr
omise.js:604:10)
    at Promise._settlePromises (D:\PhantomJS\node_modules\bluebird\js\release\pr
omise.js:683:18)
    at Promise._fulfill (D:\PhantomJS\node_modules\bluebird\js\release\promise.j
s:628:18)
    at D:\PhantomJS\node_modules\bluebird\js\release\nodeback.js:42:21
    at D:\PhantomJS\node_modules\node-phantom-simple\node-phantom-simple.js:60:1
8
    at IncomingMessage.<anonymous> (D:\PhantomJS\node_modules\node-phantom-simpl
e\node-phantom-simple.js:645:9)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at nextTickCallbackWith2Args (node.js:455:9)
    at process._tickCallback (node.js:369:17)

Here is horseman.js:

var Horseman = require('node-horseman');
var horseman = new Horseman();

horseman
  .userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
  .open('https://www.google.com/search?site=&tbm=isch&source=hp&biw=1366&bih=640&q=moon')
  .screenshot('example.jpg')
  .close();

But when I run phantomjs phantom.js it runs normally. Here is phantom.js:

var page = require('webpage').create();
page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0';
page.open('https://www.google.com/search?site=&tbm=isch&source=hp&biw=1366&bih=640&q=moon', function(status) {
  console.log("Status: " + status);
  if(status === "success") {
    page.render('example.png');
  }
  phantom.exit();
});

So I guess the problem from horseman ?

May be it's the same as #182

@minhchu
Copy link
Author

minhchu commented May 27, 2016

Please check #188
It's more details.

@minhchu minhchu closed this as completed May 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant