I've been doing a lot of scraping in node. I've had much better luck using YUI + jsdom than jquery +jsdom. Many pages would fail using jquery and it also leaked memory like crazy.
Scraping made easy with jQuery and SelectorGadget (and Node.js!)
11–19 of 19 posts
Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#12I also like this python scrape library: http://arshaw.com/scrapemark/
Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#13perl -MLWP::UserAgent -e 'map { $_ =~ s/ ([^ ([^ ]*>(\d+ points)/print "$1 $2 $3 $4\n" if($i++ new->get("http://news.ycombinator.com/")->content;'
It would be much difficult to write many more complex scrapers just using regexes, which is why methods like the one posted above scale well with complexity. For example, if you wanted to scrape comments on HN and get a tree-like data structure, regexes would be much more difficult to write and maintain!
Incidentally, the dev tools I wrote were in javascript and they created regex that we'd test in javascript and deploy in Perl. The regex engines are identical which is why it worked.
Scraper abstraction is for people too lazy to learn regex. Get a good book on regex, and learn how to use Perl's s/// regex with the 'e' modifier. It'll change your life.
Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#14All tractable problems with standard solutions, but it's difficult to accept the claim that the idea of using jQuery—which is still pretty neat IMO—now makes scraping easy.
Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#15Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#16I've been doing a lot of scraping in node. I've had much better luck using YUI + jsdom than jquery +jsdom. Many pages would fail using jquery and it also leaked memory like crazy.
Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#17Earlier quoted context omitted.
It would be much difficult to write many more complex scrapers just using regexes, which is why methods like the one posted above scale well with complexity. For example, if you wanted to scrape comments on HN and get a tree-like data structure, regexes would be much more difficult to write and maintain!
It scales. I ran WorkZoo.com (Time Mag top 50 website of 2005 - sold it the same year) and we scraped over 500 job boards and aggregated the jobs into a search engine. A team of devs developed and maintained the regex for each board and I managed them and I wrote the dev tools they used to develop the regex for each site we scraped. It was incredibly effective and maintainable. Incidentally, the dev tools I wrote wer…
For a solid scrapper in Perl I'd use HTML::TreeBuilder / HTML::Element. Perhaps slower than regexps, but does real parsing and understands tag-soup HTML.
Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#18Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)
#19Earlier quoted context omitted.
It scales. I ran WorkZoo.com (Time Mag top 50 website of 2005 - sold it the same year) and we scraped over 500 job boards and aggregated the jobs into a search engine. A team of devs developed and maintained the regex for each board and I managed them and I wrote the dev tools they used to develop the regex for each site we scraped. It was incredibly effective and maintainable. Incidentally, the dev tools I wrote wer…
... and later you begin to discover different, much better ways to solve problems that you used to do with regexps, and your life will get back to normality and happiness. ;-) For a solid scrapper in Perl I'd use HTML::TreeBuilder / HTML::Element. Perhaps slower than regexps, but does real parsing and understands tag-soup HTML.