Git Product home page Git Product logo

dmitriides / yellowpages.ca-scraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scrapehero/yellowpages-scraper

0.0 0.0 1.0 43 KB

Yellowpages.ca Web Scraper written in Python and LXML to extract business details available based on a particular category and location.

Home Page: https://www.scrapehero.com/how-to-scrape-business-details-from-yellowpages-com-using-python-and-lxml/

Python 100.00%

yellowpages.ca-scraper's Introduction

Yellow Pages Business Details Scraper - amended to work with yellowpages.ca as of Apr/2022

Yellowpages.ca Web Scraper written in Python and LXML to extract business details available based on a particular category and location.

If you would like to know more about original scraper you can check it out at the blog post 'How to Scrape Business Details from Yellow Pages using Python and LXML' - https://www.scrapehero.com/how-to-scrape-business-details-from-yellowpages-com-using-python-and-lxml/

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Fields to Extract

This yellow pages scraper can extract the fields below (it can be modified by you):

  1. Business Name
  2. Phone Number
  3. Street name
  4. Locality
  5. Region
  6. Zipcode
  7. Website
  8. Business Page
  9. Category

Prerequisites

For this web scraping tutorial using Python 3, we will need some packages for downloading and parsing the HTML. Below are the package requirements:

  • lxml
  • requests

Installation

PIP to install the following packages in Python (https://pip.pypa.io/en/stable/installing/)

Python Requests, to make requests and download the HTML content of the pages (http://docs.python-requests.org/en/master/user/install/)

Python LXML, for parsing the HTML Tree Structure using Xpaths (Learn how to install that here โ€“ http://lxml.de/installation.html)

Running the scraper

Open the script in an edditor of your choice. Modify keyword, place, pagination according to your requirements. Save changes.

Due to specific for https://www.yellowpages.ca/ link construction first verify your parameters manually.

Example. for https://www.yellowpages.ca/search/si/1/plumbing/Toronto+ON keyword = "plumbing" place = "Toronto+ON" pagination in range(1,15) - range will depend on how many pages you would like to scrape

Sample Output

This will create a csv file:

Sample Output

yellowpages.ca-scraper's People

Contributors

dmitriides avatar scrapehero-code avatar

Forkers

nkirui

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.