r7avi / Google-Maps-Data-Scrapper

Google Maps/Place Business Data Scrapper, Scrape data from any google business listed on google maps. Get Name, Address, Phone Number, Plus Code, Reviews, Longitude and Latitude etc. Scrape Emails from Available Websites and Docker Support for automation.
MIT License
5 stars 0 forks source link
data-scraper google-data-scrape google-maps google-maps-data-scraper google-maps-scraper google-maps-scraper-python google-maps-scrapping google-places-scraper google-scrapers longitude-and-latitude python python3

Google-Maps-Scrapper

This project provides a set of Python scripts to scrape data from Google Maps using the Playwright library for automated web browsing. The data scraped includes names, addresses, phone numbers, websites, pluscode, longitude / latitude, ratings and other relevant details of listings found on Google Maps.

Table of Contents

Prerequisite

Modules

Key Features

Installation

  1. Clone this repository:

    
    git clone https://github.com/r7avi/Google-Maps-Scrapper.git
  2. Navigate to the project directory:

    
    cd google-maps-scraping
  3. Update PIP:

    
     python -m pip install --upgrade pip
  4. Install the required Python packages:

    pip install -r requirements.txt

    or

    pip install playwright pandas openpyxl tqdm playwright install

How to Use:

To use this script, follow these steps:

  1. Start the script run.py.

    python run.py
  2. Choose to input a search term manually or use Query.txt.

    doctors in new york
    dentist in new yersy
  3. Enter the total number of results you want to scrape in run.py Line : 16

    Min: 20 (Default) & Max: 150  ## Recommended 120
  4. The script will navigate to Google Maps, perform searches, scrape data, and save it into Excel files in the output directory.

Debugging

Line 45 in scraper.py & Line 15 in run.py #Change the path of chrome.exe as Required

   executable_path='C:\Program Files\Google\Chrome\Application\chrome.exe' : Make sure you have chrome installed in your system and the path is correct

Headless Browser Mode

   headless=False : Set to True if you don't want to see the browser window

Docker :

  1. If you want to run in Docker ,In Docker/app : update Query.txt and Modify Server details in Scrapper.py and add your Linux SSH Details so Scrapped data can be stored in your Linux server else It will be stored Locally in app/output.

    Execute below command in Docker folder . [Note You Must Have Docker Installed in your Win/Linux]

     docker-compose up --build

Other Helpful Docker Commands : https://github.com/r7avi/Google-Maps-Scrapper/blob/main/docker/Docker-Commands.txt