Live data from Hacker News

Scraping made easy with jQuery and SelectorGadget (and Node.js!)

blog.dtrejo.com

1–10 of 19 posts

Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)

#6
People using clojure can get selector based scraping using Enlive instead of JQuery [1]. It also ends up doubling as a templating library. I use it for templating on my website and I use it to scrape Hacker News, though that project the scraping is for isn't ready for launch [2].

1: https://github.com/cgrand/enlive

2: https://github.com/jColeChanged/mysite

Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)

#7
post #6

People using clojure can get selector based scraping using Enlive instead of JQuery [1]. It also ends up doubling as a templating library. I use it for templating on my website and I use it to scrape Hacker News, though that project the scraping is for isn't ready for launch [2]. 1: https://github.com/cgrand/enlive 2: https://github.com/jColeChanged/mysite

And here's a truly awesome tutorial for enlive (swannodette is a regular here as well):

http://github.com/swannodette/enlive-tutorial

Re: Scraping made easy with jQuery and SelectorGadget (and Node.js!)

#9
post #3

perl -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!

Post reply on HN