Skip to content

Instantly share code, notes, and snippets.

@Meekohi
Last active December 15, 2015 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Meekohi/5341326 to your computer and use it in GitHub Desktop.
Save Meekohi/5341326 to your computer and use it in GitHub Desktop.
function scrapePage(names){
var facts;
if(names.length <= 0) phantom.exit();
var name = names.shift(); //shortens the array and returns an item
page2.open(name, function(status) {
console.log("wtf on " + name);
//do work here
scrapePage(names);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment