Skip to content

Instantly share code, notes, and snippets.

@czardoz
Forked from papoms/loadlist.phantom.js
Created January 24, 2014 11:17
Show Gist options
  • Save czardoz/8595595 to your computer and use it in GitHub Desktop.
Save czardoz/8595595 to your computer and use it in GitHub Desktop.
var urls = [
'http://keyworddomains.com',
'http://blog.keyworddomains.com',
'http://timer.keyworddomains.com'
];
var page = require('webpage').create();
function process(){
if (urls.length == 0){
phantom.exit();
} else{
url = urls.pop();
page = require('webpage').create();
page.open(url, onFinishedLoading)
}
}
function onFinishedLoading(status){
// get the currentUrl
var currentUrl = page.evaluate(function() {
return document.location.href;
});
console.log('Loading ' + currentUrl + ' finished with status: ' + status);
page.release();
process();
}
process();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment