Created
September 5, 2012 07:21
-
-
Save pracj3am/3632521 to your computer and use it in GitHub Desktop.
Open URL with phantomJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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