A high-performance, asynchronous web scraper for Google Maps business listings built with Python and Playwright.
- Concurrent Scraping: Uses
asyncioto process multiple search queries and pages simultaneously. - Detailed Extraction: Scrapes business name, address, phone, website, operating hours, and more.
- Resilient: Implements retry logic and robust error handling.
- Anti-Detection: Uses
patchrightto avoid bot detection and blocking.
-
Install Dependencies with uv:
uv sync
-
Install Browsers:
uv run patchright install chromium
Create two files in the project directory to define your search parameters:
-
keywords.txt: A list of business types to search for (one per line).plumbers coffee shops -
locations.csv: A CSV file defining the target areas.City,State,Country Baltimore,MD,USA Columbia,MD,USA
Run the script:
uv run gmap_scraper.pyThe results will be saved to gmap_scraper_output.csv.