Fenrir
Fenrir

Reputation: 23

PhantomJS.Org takes too long to respond against my phantom js script?

I have a simple script I got from "Getting Started with PhantomJS" book.

var system = require('system');
   var url = system.args[1];
   var page = require('webpage').create();
   page.open(url, function(status) {
     if ( status === "success" ) {
       console.log("Page is loaded.");
       phantom.exit(0);
} });

When I run a command like "phantomjs chapter2.js http://www.google.com" I get the correct response of "Page is loaded". Same with facebook.com

It's funny because the book told me to run "phantomjs chapter2.js http://www.phantomjs.org", but all it does is hang on me for a minute before the script stops and goes back to the command prompt without printing anything back.

Is it a problem on my end with my internet connection?

Upvotes: 2

Views: 169

Answers (2)

ѺȐeallү
ѺȐeallү

Reputation: 3017

The page http://www.phantomjs.org does not resolve.

http://isup.me/www.phantomjs.org shows a dead end.

Upvotes: 0

Mr. Llama
Mr. Llama

Reputation: 20889

The www subdomain of phantom.js is a dead end: http://isup.me/www.phantomjs.org

Remove the subdomain and it'll work as expected: http://isup.me/phantomjs.org

Upvotes: 2

Related Questions