Tutorial: How to Scrape Data From Yellowpages

  • AS Team
  • Dec 10, 2020
Tutorial: How to Scrape Data From Yellowpages title banner

If you want to start a business directory which can give information about phone numbers, addresses and directions of all the local businesses, then Yellowpages is the best source. 

 

Yellowpages is the massive storehouse of local businesses, restaurants, hotels, and services. Yellowpages is a business information portal where local businesses can list themselves so that people of that locality can locate the right business for their needs conveniently and quickly.

 

To collect information about this business from Yellowpages, you can use web scraping technology. Web Scraping helps you to easily collect a large amount of data in a structured format in a very short period. (Also read: Data Scraping in R)

 

but, you may some questions on your mind like,

 

  • Is it possible to scrape data from the Yellowpages?

  • How can you get the specific contact details list of the particular business from the yellow page using a web scraper?

  • Is web scraping an easy option for non-technical people?

 

Don’t worry…

 

In this tutorial, we will scrape data from Yellowpages using ProWebScraper, without writing a single line of code.  

 

We will scrape the following fields, from the YellowPages Business Page:

 

  1. Business Name

  2. Address 

  3. Phone

  4. Opening Hours

  5. Website

 

Below is a screenshot of the data which we will be scrapping.


The image is highlighting the screenshot of data from which data will be scraped.

Scraping data page


Well, let’s begin.

 

To simplify things, we have divided the entire process into 3 stages 

 

  1. Create A Free Account at ProWebScraper

  2. Create and Configure a Scraper

  3. Downloading Your Data

    

Step 1: Create A Free Account at ProWebScraper

 

Go to Prowebscraper.com and create a free account. With ProWebScraper, you can scrape 1000 pages for free.

 

Once you’ve logged in for ProWebScraper, you’ll be brought to your ProWebScraper scraper tab. Here’s how it’ll look like: 


Displaying ProWebScraper scraper tab

ProWebScraper scraper tab


Step 2: Create & Configure Scraper

 

  • Now we will start to create and configure our scraper by entering an URL of the YellowPages Business Page. 

  • Once the website is loaded at the ProWebScraper, then we will select the desired review data by ProWebScraper's easy point-and-click selector feature.

  • Let's have a look at the whole flow, step-by-step:

 

(2.1): Insert URL at ProWebScraper’s Scraper tab:

 

At ProWebScraper Scraper tab, 

Start by copy and paste the URL of the YellowPages Business Page, such as https://www.yellowpages.com/new-york-ny/mip/chelsea-towing-nyc-456108603, and click on “Go” to load the page.


Illustrating step for doing copy and paste the link at the tab

Illustrating step for doing copy and paste the link at the tab


(2.2) Select a business name

 

  • Once the page is loaded, you can start configuring the scraper.

  • All you need to do is click on the data point of the page to select that data point.

  • To scrape the title of the product, just click on that.

  • To name this data point, either double click on the column name or from the list of data columns settings select rename.


Reflecting the step of selecting a business name.

Selecting a business name


(2.3): Add a new column and select other details

 

To scrape more data points such as Address, Opening Hours, etc. you just need to click on the “Add column”, and then click that data point on the page to select that data point and rename it.

 

Here is an example of how to “Add Column” and rename it for Address. You can do the same for other fields too.


Illustrating how to add a column and it appears.

Illustrating adding a new column


(2.4): Get the website by using CSS selector

 

  • If you want to select a website then we need to use CSS Selector.

  • Here is an example of how to apply the CSS selector to get data.

  • Go to column setting, click “Use CSS Selector”, then you need to enter a selected string in a CSS selector

    • Enter Selector: “a.primary-btn.website-link” 

    • Enter Attribute: “href”

  • Then click on apply, you will get a business website.


Highlighting how to apply CSS selector

Using CSS selector


(2.5): Save scraper and run

 

  • Once all the data points have been selected, then Save the scraper. Click the “Save” button to save your scraper. 

  • You can enable or disable the option ”is this listing page” based on your scraper.

  • For now, we will disable this option as we are scraping details.


Saving and running a scraper.

Saving and running a scraper


  • Once the scraper is saved, it will take you to the scraper Dashboard. From there, you can download the results of the run once it is over.

 

Step 3: Downloading Your Data in CSV or JSON

 

After the scraper is successfully finished, your data will be available for download within the Scraper Dashboard.

 

  • You can easily access the data from the Run History tab. You can see the previous runs including the latest one with the results at the top.

  • The data will be available for download (1) in JSON or CSV format.

  • You can see the "Data Preview" of scraped data (2).


Getting data in JSON and CSV format.

Downloading data in JSON and CSV format


Sample Data File (CSV Format) :

 

https://drive.google.com/file/d/1fK_VQ-cls-DdY0dRtKcKl0EhbFhScPF2/view?usp=sharing 

 

Sample Data Preview:


Previewing data sample

Sample data preview



 

Challenges to Scrape Data From Yellowpages

 

The main aim of this website is to organize business information and technology to eliminate the gap between business and their customers. But when you want to scrape data from such a website, you may go through some difficulties mentioned below.

 

If you want large volume data in a short period, there is a chance that the website owner can just block all the requests coming from that specific datacenter so the scrapers will not be able to access the site. Because website owners recognize that there are a lot of non-human requests coming from this set of IPs.

 

With ProWebScraper, you don’t need to worry about any web scraping challenges. ProWebScraper can handle all web scraping challenges for you and provides you structured data at scale.


 

Conclusion

 

If you are in a sales or marketing business, the bottom line is you need to have lots of leads to sell your products.

 

ProWebScraper helps you to collect contact details of any businesses/services at a large scale.

 

We hope this blog will be helpful to you in understanding and learning the web scraping process using ProWebScarper. Do share your valuable feedback and suggestions to help us grow!!!!

Latest Comments