Wednesday 25 September 2013

How to scrape Yellow Pages with ScreenScraper Chrome Extension

Recently I was asked to help with the job of scraping company information from the Yellow Pages website using the ScreenScraper Chrome Extension. After working with this simple scraper, I decided to create a tutorial on how to use this Google Chrome Extension for scraping pages similar to this one. Hopefully, it will be useful to many of you.
1. Install the Chrome Extension

You can get the extension here. After installation you should see a small monitor icon in the top right corner of your Chrome browser.
2. Open the source page

Let’s open the page from which you want to scrape the company information:


3. Determine the parent element (row)

The first thing you need to do for the scraping is to determine which HTML element will be the parent element. A parent element is the smallest HTML element that contains all the information items you need to scrape (in our case they are Company Name, Company Address and Contact Phone).  To some extent a parent element defines a data row in the resulting table.

To determine it, open Google Chrome Developer Tools (by pressing Ctrl+Shift+I), click the magnifying class (at the bottom of the window) and select the parent element on the page. I selected this one:

As soon as you have selected it, look into the developer tools window and you will see the HTML code related to this element:



Source: http://extract-web-data.com/how-to-scrape-yellow-pages-with-screenscraper-chrome-extension/

No comments:

Post a Comment