Ask HN: How to aggregate product info from other websites
Any input on the best way to aggregate product information from various websites would be much appreciated. Most of the websites I would like to aggregate lack any APIs that I could use to track prices and things of that nature.
I have zero experience web scraping of any kind so any direction would be helpful. Before I start digging I figured HNers may have some invaluable advice.
21 comments
[ 3.5 ms ] story [ 43.6 ms ] threadPython has SGML SAX parser and since HTML is SGML it can be used. Better than regexps any day.
Python's http client library also supports cookies so that you can pretend to have a "session" with your target website.
EDIT: the libraries are urllib2, sgmllib, cookielib
What experiences has everyone else had?
Example: http://developer.yahoo.com/shopping/
http://code.whytheluckystiff.net/hpricot/
http://www.igvita.com/2007/02/04/ruby-screen-scraper-in-60-s...
http://github.com/tenderlove/nokogiri/tree/master
If you're wondering why, well, consider this script that "learns" how to scrape Google results (from one supplied example of output data):
Reads almost like English in the scraping part!