Scraping the web with Node.io
coderholic.com
coderholic.com
The main thing I'd like to point out is that I built it primarily as a command line tool. "By implementing an input method there’s no way to specify a search term from the command line" - so leave/comment the input method out! The default input method is to read lines from STDIN, just like the default output method is to write to STDOUT
Try commenting out the input line on that google example and running it with a list of words in a file:
node.io google_keywords < input.txt
Or you could feed the results in to another node.io job: cat input.txt | node.io google_keywords | node.io someotherjob1. JS selectors make scraping _very_ easy.
2. Asynchronous is fast as it is, but the page is actually parsed as it's received - contrast this with other scraping solutions where you need to download a page and parse it once it's complete.
3. With asynchronous scraping it's trivial to handle failures, timeouts, retries, nested requests, recursing similar URLs, concurrent requests, etc. - just add one of the many options (https://github.com/chriso/node.io/wiki/API---Job-Options)
jsdom: 1
external_resources: 1
Watch this space: https://github.com/chriso/node.io/blob/master/lib/node.io/do...