A terminal-only CLI that scrapes Google Maps for business leads (name, phone, URL) and exports them to CSV. No web app, no UI—just run it in your terminal.
- Search by profession + location (e.g. Gyms in Noida) or a custom query
- Verify location & profession before scraping (with smart spelling hints, e.g. noda → Noida)
- Choose how many leads you want (50–1000)
- Export to CSV:
name,phone,url
Runs entirely in the command line. No frontend.
- Python 3.10+
- Chromium (installed via Playwright in the setup step below)
git clone https://github.com/YOUR_USERNAME/google-maps-scraper.git
cd google-maps-scraperpython -m venv .venvActivate it:
| OS | Command |
|---|---|
| Windows (PowerShell) | .\.venv\Scripts\Activate.ps1 |
| Windows (CMD) | .\.venv\Scripts\activate.bat |
| macOS / Linux | source .venv/bin/activate |
pip install -r requirements.txt
python -m playwright install chromiumIf
playwrightisn’t found, always use:python -m playwright install chromium
python google_maps_scraper.pyYou’ll be prompted for profession, location, verification, and number of leads. Output is saved as {profession}_{location}.csv in the current folder.
Prompts for profession, location, verification, and number of leads:
python google_maps_scraper.pyExample flow:
Enter profession (e.g. Gyms): Restaurants
Enter location (e.g. Noida): Greater Noida
Profession: Restaurants
Location: Greater Noida
We'll scrape data for: "Restaurants" in "Greater Noida".
Proceed? (y/n): y
How many leads do you want? (50-1000, default 50): 100
Run without interactive prompts by passing flags:
# By profession + location
python google_maps_scraper.py --profession "Gyms" --location "Noida" --max 200
# Custom full query
python google_maps_scraper.py --query "Dentists in Mumbai" --max 150
# Custom output file
python google_maps_scraper.py --profession Restaurants --location "Greater Noida" --max 100 --out my_leads.csv
# Headless (browser runs in background)
python google_maps_scraper.py --profession Gyms --location Delhi --max 50 --headless
# Skip verification step
python google_maps_scraper.py --profession Gyms --location Noida --no-verify --max 80| Option | Description |
|---|---|
--query |
Full search string (e.g. "Gyms in Noida"). Overrides profession/location. |
--profession |
Category (e.g. Gyms, Restaurants, Dentists). |
--location |
Place (e.g. Noida, Mumbai, Uttar Pradesh). |
--max |
Number of leads to scrape (50–1000). If omitted, you’re prompted. |
--out |
Output CSV path. Default: {profession}_{location}.csv; with --query only, results.csv. |
--headless |
Run browser in background (no visible window). |
--no-verify |
Skip the “Proceed? (y/n)” verification step. |
- Format: CSV
- Columns:
name,phone,url - Default filename:
{profession}_{location}.csv(e.g.restaurants_greater_noida.csv)
Google Maps returns more results when the search is broader:
| Search scope | Typical lead count |
|---|---|
| State (e.g. Restaurants in Uttar Pradesh) | up to ~1000 |
| District (e.g. Restaurants in Gautam Buddha Nagar) | up to ~200 |
| City (e.g. Restaurants in Greater Noida) | ~50–80 |
Use a state or district for more leads; use a city for a smaller, focused list.
- Consent / CAPTCHA: Google may show a consent or “unusual traffic” page. Running in headed mode (default) and solving any CAPTCHA usually helps.
- Debug: If the script can’t find the search box, it may save
debug_maps.pngin the current folder. - Legal: Use responsibly and comply with Google’s Terms of Service and local laws.
A modern, dark-themed web interface is now available for the scraper with enhanced features:
- Modern Dark Theme UI - Clean, professional interface with glass morphism effects
- Real-time Progress Tracking - Live progress bar with time estimation
- Multiple Export Formats - CSV, Excel, and PDF export options
- Advanced Results Table - Sortable, searchable, and paginated results
- Responsive Design - Works perfectly on desktop and mobile devices
- Copy to Clipboard - Quick copy functionality for phone numbers
-
Start the Web Application
python app.py
-
Open in Browser Navigate to
http://localhost:5000 -
Use the Web Interface
- Enter business type/profession (e.g., "Restaurants", "Gyms", "Salons")
- Enter location (e.g., "New York", "Mumbai", "London")
- Select number of leads to scrape
- Click "Start Scraping"
- Monitor real-time progress
- Export results in your preferred format
POST /api/start_scraping- Start a new scraping taskGET /api/scraping_status/<task_id>- Get scraping progress and resultsGET /api/export/<task_id>/<format>- Export results (csv, excel, pdf)
The web frontend requires additional dependencies (already included in requirements.txt):
- Flask & Flask-CORS
- Pandas
- ReportLab (for PDF generation)
- openpyxl (for Excel export)
google-maps-scraper/
├── google_maps_scraper.py # Main CLI script
├── app.py # Flask web application
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # Web frontend interface
├── README.md # This file
└── .gitignore
Both CLI and web interfaces are available. Use the CLI for quick terminal operations, or the web interface for a more user-friendly experience with enhanced features.
Use at your own risk. For educational purposes.