-
-
Save rbg246/edb1303151c151422add to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Spooky, config, i, run_spooky, scraping, spooky, spooky_is_ready; | |
Spooky = require('spooky'); | |
config = { | |
child: { | |
port: 8081 | |
} | |
}; | |
spooky = null; | |
i = 1; | |
scraping = function() { | |
console.log("new") | |
spooky.start("http://www.chrispie.com"); | |
spooky.thenEvaluate(function () { | |
console.log('Hello, from', document.title); | |
}); | |
return spooky.run(); | |
}; | |
spooky_is_ready = function(err, res) { | |
spooky.on('console', function(line) { | |
return console.log(line); | |
}); | |
spooky.on('run.complete', function(){ | |
console.log("FINISH"); | |
spooky.destroy(); | |
spooky = new Spooky(config, spooky_is_ready); | |
}) | |
return scraping(); | |
}; | |
spooky = new Spooky(config, spooky_is_ready); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
calls multiple times now rather than stopping after first run through, so you would then add an array of links to iterate through to carry out a series of tests on