Skip to content

Instantly share code, notes, and snippets.

@thecodejunkie
Created June 24, 2013 12:03
Show Gist options
  • Save thecodejunkie/5849584 to your computer and use it in GitHub Desktop.
Save thecodejunkie/5849584 to your computer and use it in GitHub Desktop.
var page = require('webpage').create();
var system = require('system');
var address;
address = system.args[1];
console.log(address);
page.open(address, function(status) {
console.log(status);
});
console.log('Done');
phantom.exit();
@robashton
Copy link

Lol - yes sorry ,obvious thing - if you call it at the end it'll be called before the page is opened and you'll never get the callback

@robashton
Copy link

My tests tend to do

before(function(done) {
  setupPhantom(done)
})

after(function(done) {
  closePhantom()
})

@thecodejunkie
Copy link
Author

Oooh, hehe yeah that make sense. Cheers!

@thecodejunkie
Copy link
Author

I've not gotten that far.. literally using it for the first time today and I'm following their "Getting Started" section before I dig any deeper :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment