3 ms·
I worked in a similar vein with Horseman: http://horsemanjs.org/ http://horsemanjs.org/ The library runs PhantomJS. While there are many libraries that do thi
by impostervt 11y ago
I worked in a similar vein with Horseman:
http://horsemanjs.org/ http://horsemanjs.org/
The library runs PhantomJS. While there are many libraries that do this, I wanted a synchronous, chainable API. So I could do
var links = horseman.count('a');
if (count > 3) {
horseman.open('http://www.google.com' http://www.google.com')
} else {
horseman.open('http://www.yahoo.com' http://www.yahoo.com')
}
Under the hood, using the library literally blocks. Which is a very, very un-javascript/Node thing to do, and introduces other weirdness, I know.