Skip to content

Instantly share code, notes, and snippets.

@pracj3am
Created September 5, 2012 07:21
Show Gist options
  • Save pracj3am/3632521 to your computer and use it in GitHub Desktop.
Save pracj3am/3632521 to your computer and use it in GitHub Desktop.
Open URL with phantomJS
var page = require('webpage').create();
var url = 'http://localhost:9876/capture';
var log = function(str) {
var dt = new Date();
console.log(dt.toString() + ': ' + str);
};
var pageLoaded = function(status) {
log('Finished loading ' + url + ' with status: ' + status);
};
var capture = function() {
log('Attempting to load: ' + url);
page.open(url, pageLoaded);
};
capture();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment