Skip to content

πŸ“ Extract business data from Google Maps β€” names, addresses, phones, websites, hours. Python + Selenium. Free & open source.

License

Notifications You must be signed in to change notification settings

SoCloseSociety/GoogleMapScraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Google Maps Scraper

Extract business data from Google Maps β€” names, addresses, phone numbers, websites and hours in one command.

License: MIT Python 3.9+ Platform Selenium GitHub Stars Issues Forks

Quick Start β€’ Features β€’ Configuration β€’ FAQ β€’ Contributing


What is Google Maps Scraper?

Google Maps Scraper is a free, open-source Google Maps data extraction tool built with Python and Selenium. It lets you scrape business information from any Google Maps search β€” names, addresses, phone numbers, websites, and opening hours β€” into clean CSV files.

Need to build a lead list, research local businesses, or gather market data? This scraper automates what would take hours of manual copy-pasting. Provide a search query or URL, and get a ready-to-use CSV.

Who is this for?

  • Sales Teams building lead lists of local businesses
  • Market Researchers analyzing business density by area
  • Real Estate Agents studying commercial activity in neighborhoods
  • Startup Founders doing competitive landscape analysis
  • SEO Agencies auditing local business listings
  • Data Analysts collecting location-based business data

Key Features

  • Single Command - Provide a search query or URL, get a CSV
  • Two-Phase Scraping - Collects all place links first, then extracts details
  • Crash-Safe - Progress saved after each extraction; interrupt and resume anytime
  • Headless Mode - Run without a visible browser window
  • Smart Scrolling - Automatically detects when all results are loaded
  • Anti-Detection - Randomized delays, clean browser fingerprint
  • CLI-First - Fully scriptable with argparse options
  • Lightweight - Only 4 dependencies, no bloat
  • Cross-Platform - Works on Windows, macOS, and Linux
  • Free & Open Source - MIT license, no API key required

Quick Start

Prerequisites

Requirement Details
Python Version 3.9 or higher (Download)
Google Chrome Latest version (Download)

Installation

# 1. Clone the repository
git clone https://github.com/SoCloseSociety/GoogleMapScraper.git
cd GoogleMapScraper

# 2. (Recommended) Create a virtual environment
python -m venv venv

# Activate it:
# Windows:
venv\Scripts\activate
# macOS / Linux:
source venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

Usage

# Search by query
python main.py -q "restaurants+paris" -o my_results

# Search by full Google Maps URL
python main.py -u "https://www.google.com/maps/search/dentist+london/" -o dentists

The scraper will:

  1. Open Chrome and search Google Maps
  2. Scroll through all results and collect every place link
  3. Visit each place and extract business details
  4. Save everything to CSV files

All CLI Options

python main.py --help
Option Description Default
-u, --url URL Full Google Maps search URL None
-q, --query QUERY Search query (spaces replaced with +) None
-o, --output NAME Base name for output CSV files output
--headless Run Chrome without visible browser window Off
--links-only Only collect links, skip detail extraction Off
--from-links CSV Skip link collection, extract from existing CSV None

Examples

# Headless mode (no browser window)
python main.py -q "bakery+tokyo" -o bakeries --headless

# Collect links only (fast reconnaissance)
python main.py -q "gym+berlin" -o gyms --links-only

# Resume from a previous links file (skip Phase 1)
python main.py --from-links gyms_links.csv -o gyms

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    PHASE 1                           β”‚
β”‚         Scroll & Collect Place Links                 β”‚
β”‚                                                      β”‚
β”‚  Google Maps URL ──> Scroll feed ──> Extract /maps/  β”‚
β”‚                      place/ links ──> Save CSV       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    PHASE 2                           β”‚
β”‚         Visit Each Place & Extract Details           β”‚
β”‚                                                      β”‚
β”‚  For each link ──> Load page ──> Parse HTML ──>      β”‚
β”‚  Extract name, address, phone, website, schedule     β”‚
β”‚  ──> Append to CSV (crash-safe)                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Extracted

Field Description
Name Business name
Address Full street address
Phone Phone number
Website Business website URL
Schedule Opening hours

Configuration

You can adjust these constants at the top of main.py:

Constant Default Description
DEFAULT_DELAY (2, 4) Random delay range between requests (seconds)
PAGE_LOAD_TIMEOUT 15 Max wait for page elements (seconds)
SCROLL_PAUSE 1.5 Pause between scrolls (seconds)
MAX_SCROLL_STALLS 15 Stop scrolling after N stalls with no new links

Project Structure

GoogleMapScraper/
β”œβ”€β”€ main.py              # Main scraper script
β”œβ”€β”€ requirements.txt     # Python dependencies
β”œβ”€β”€ assets/
β”‚   └── banner.svg       # Project banner
β”œβ”€β”€ LICENSE              # MIT License
β”œβ”€β”€ README.md            # This file
β”œβ”€β”€ CONTRIBUTING.md      # Contribution guidelines
└── .gitignore           # Git ignore rules

Troubleshooting

Chrome driver issues

The scraper uses webdriver-manager to automatically download the correct ChromeDriver. If you encounter issues:

pip install --upgrade webdriver-manager

No results found

If the scraper doesn't find any links:

  1. Try using a full Google Maps URL with -u instead of a query
  2. Make sure Chrome is up to date
  3. Try without --headless to see what's happening

Google Maps UI changes

Google occasionally updates its interface. If the scraper breaks:

  1. Check the Issues page
  2. Open a new issue with the error message

FAQ

Q: Is this free? A: Yes. Google Maps Scraper is 100% free and open source under the MIT license.

Q: Do I need a Google Maps API key? A: No. This tool uses browser automation (Selenium), so no API key is needed.

Q: How many businesses can I scrape? A: The tool scrapes all results returned by Google Maps for your search. Just be mindful of Google's usage policies.

Q: Can I resume a failed scrape? A: Yes! Use --from-links to resume from a previously saved links CSV.

Q: Does it work on Mac / Linux? A: Yes. Fully cross-platform on Windows, macOS, and Linux.

Q: Can I run it without a browser window? A: Yes. Use --headless mode.


Alternatives Comparison

Feature Google Maps Scraper Manual Copy-Paste Google Places API Outscraper
Price Free Free $0.02/request $2.50/1000
Bulk extraction Yes No Yes Yes
Crash recovery Yes N/A N/A N/A
Open source Yes N/A No No
API key required No No Yes Yes
Cross-platform Yes Yes Any Web only
Headless mode Yes N/A N/A N/A

Contributing

Contributions are welcome! Please read the Contributing Guide before submitting a pull request.


License

This project is licensed under the MIT License.


Disclaimer

This tool is provided for educational and research purposes only. Scraping Google Maps may violate Google's Terms of Service. You are solely responsible for how you use this tool. The authors are not responsible for any misuse or consequences arising from the use of this software.


If this project helps you, please give it a star!
It helps others discover this tool.

Star this repo


Built with purpose by SoClose β€” Digital Innovation Through Automation & AI
Website β€’ LinkedIn β€’ Twitter β€’ Contact

About

πŸ“ Extract business data from Google Maps β€” names, addresses, phones, websites, hours. Python + Selenium. Free & open source.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages