Skip to content
onepiece92Public

About

google map scraper

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

gMap - Google Maps Data Scraper

A powerful and flexible Google Maps scraper built with Python and Playwright. It supports both simple keyword searches and advanced grid-based mining for broad geographic coverage.

Features

  • Simple Search: specific queries (e.g., "restaurants in Kathmandu").
  • Grid Mining: Automatically generates a grid of coordinates to scrape large areas systematically.
  • Data Extraction: Extracts Name, Phone, Website, Email (from website), and Location Link.
  • Headless Mode: Runs in the background by default.
  • CSV Export: Automatically saves results to results.csv.

Installation

  1. Clone the repository:

    git clone https://github.com/onepiece92/gMap.git
    cd gMap
  2. Install dependencies:

    pip install -r requirements.txt
  3. Install Playwright browsers:

    playwright install chromium

Usage

1. Simple CLI Usage

Run a quick search directly from the command line:

python main.py "coffee shops in New York" --total 20
  • --total: Number of results to scrape (default: 10)
  • --visible: Run with the browser visible (useful for debugging)

2. Configuration File (Recommended)

Create or edit config.json for more control:

{
  "search_query": "dentist",
  "location": "London",
  "total": 500,
  "grid_size": 5,
  "zoom_level": 15,
  "headless": true
}

Run the scraper:

python main.py

Grid Mining

The robust "Grid Mining" mode activates automatically if total target is > 120. It will:

  1. Discover the coordinates of the target location.
  2. Generate a grid of search points around that location.
  3. Systematically mine each grid tile to maximize results and bypass Google Maps' scroll limits.

Project Structure

  • main.py: Entry point and logic flow.
  • scraper/: Core scraping modules.
    • engine.py: Playwright browser automation.
    • grid.py: Coordinate grid generation logic.
    • extractor.py: Text extraction utilities.
    • storage.py: CSV saving handlers.

Disclaimer

This tool is for educational purposes only. scraping public data. Please respect platform Terms of Service.

About

google map scraper

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages