Scraping Google Catalogs
Scrape and save Google catalog search results to a comma-delimited file.
The December-Holiday-of-Your-Choice comes but once a year, but catalog shopping is a year-round joy. And Google Catalogs [Hack #33] makes it easier than ever.
Of course, just because you spend a rainy winter afternoon finding the perfect shawl for Aunt Prunella doesn’t mean that you’ll be able to replicate the search when you need it. Or maybe you want to do a search for several things and browse them at your leisure later.
Because Google Catalogs aren’t supported by the Google API, this hack scrapes finds from the HTML of a Google Catalogs results page. It saves the catalog title, date or season, page number, and even a link to an image of the page itself at Google. Results are saved in CSV format, ready for import into a database or spreadsheet application.
Because Google’s Terms of Service prohibits the automated access of their search engines except through the Google API, this hack does not actually connect to Google. Instead, it works on a page of results that you’ve saved from a Google Catalogs search you’ve run yourself. Simply save the results page as HTML source using your browser’s File → Save As... command.
As with the Google News hack [Hack #47], you can optimize the
effectiveness of this hack by changing the results URL ever so
slightly to tweak the order of any data displayed. By adding a
&num=100 to the end of the catalog search results URL, you’ll get up to 100 results ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access