Pro scraping with Node.JS
github.com
github.com
https://github.com/chriso/node.io uses https://github.com/harryf/node-soupselect
https://github.com/harryf/node-soupselect is a port of my https://github.com/simonw/soupselect library for Python
https://github.com/simonw/soupselect is a port of my getElementsBySelector function for JavaScript: http://simonwillison.net/2003/Mar/25/getElementsBySelector/
I'm always surprised to see that code still being used - it's the least complete selector library out there by a long way.
For this use case being complete doesn't matter so much as users are just after a handy way pull content out of a page. And having "got intimate" with the source while porting it, it's a really elegant piece of code - have the impression that try to make it do more would ruin it.
$ perl -Mojo -e'g("reddit.com")->dom("a.title")->each(sub { warn shift->text })'So while GET-ting pages to scrape can benefit from async IO, you're effectively "blocked" while scraping pieces out of the page itself.
Does anyone knows how it compares to say Nokogiri or Hpricot, both in terms of speed and in terms of ability to handle crappy html ?
Have you tried using Aria's html5 parser? I hear it works better with malformed markup.
Anyway, will try your method soon.
Example: https://github.com/tszming/Selenium-Google-Scrapper