LEAD GENERATION // STANDALONE AUTOMATION ENGINE
gmaps_scraper.py
> Google Maps Local Lead Generator
Headless browser automation tool that crawls Google Maps to extract verified business names, direct phone numbers, addresses, and websites into clean CSVs.
// COMMAND INVOCATION:
python gmaps_scraper.py --query="Coffee Shops" --location="Seattle, WA" --max=10 --output="leads.csv"
// SUPPORTED COMMAND-LINE ARGUMENTS:
| ARGUMENT FLAG | TYPE | DEFAULT | DESCRIPTION |
|---|---|---|---|
--query |
string | 'Coffee Shops' | Industry, niche, or business category keyword |
--location |
string | 'Seattle, WA' | Target city, state, or metropolitan postal area |
--max |
integer | 10 | Maximum number of verified business leads to collect |
--output |
filepath | 'leads.csv' | Destination UTF-8 CSV spreadsheet filename |
// PRODUCTION OUTPUT SCHEMA (CSV / Excel) — SAMPLE EXTRACTED DATASET:
| business_name | phone | address | website | rating | reviews_count |
|---|---|---|---|---|---|
| Storyville Coffee Pike Place | +1 206-780-5777 | 94 Pike St, Seattle, WA 98101 | https://storyville.com | 4.8 | 1,248 |
| Coffee TAB Downtown | +1 425-243-7356 | 1124 2nd Ave, Seattle, WA 98101 | http://coffeetab.org | 4.9 | 312 |
| Overcast Coffee Roasters | +1 206-588-2621 | 214 1st Ave S, Seattle, WA 98104 | http://overcastcoffee.co | 4.7 | 584 |
| Victrola Coffee Roasters | +1 206-325-6520 | 310 E Pike St, Seattle, WA 98122 | https://victrolacoffee.com | 4.6 | 980 |
• Ready for direct import into PostgreSQL, MongoDB, Airtable, HubSpot, or Microsoft Excel without pre-processing.
Technical Specifications & Implementation Details
An industrial-grade local business lead scraping engine built for B2B prospecting, cold outreach, and market research. Combines Playwright browser automation to navigate Google Maps' Single Page Application (SPA) infinite scroll with a resilient BeautifulSoup HTTP fallback. Automatically strips private unicode icon glyphs, parses international phone standards, and exports structured spreadsheets ready for your CRM.
- • Dual-engine architecture: Playwright Chromium browser + lightweight HTTP fallback
- • Automated infinite feed scroll with dynamic height calculation
- • Extracts: Business Name, Phone Number, Physical Address, Website, Rating, and Review Count
- • Regex text sanitization removing icon artifacts (\ue0b0, \ue30c) and line breaks
- • Pandas UTF-8-SIG CSV export compatible with Microsoft Excel and Google Sheets
// 3-STEP EXECUTION PIPELINE
From Download to Production in 60 Seconds
Run pip install -r requirements.txt in your virtual environment to load required packages.
Pass your target keywords, URLs, price thresholds, or proxy lists via simple CLI command flags.
The script parses the live target and generates pristine UTF-8 spreadsheets, media, or JSON files.
Unlock gmaps_scraper.py Source Code
Complete a free sponsor offer to unlock the standalone Python script immediately. Includes full documentation and requirements.txt.
// DISCOVER MORE ENGINES