gmbscraper
A typed, importable Playwright scraper for Google Maps / Google Business Profile data: place search, place details, identity-based matching, review scraping, and parallel fan-out helpers.
- Search Google Maps and scrape place details (name, category, address, phone, website, rating, review count) without the official (paid, rate-limited) Places API.
- Adaptive quadrant search that recursively splits the map viewport to pull results beyond Google's ~120-per-query cap.
- Confidence-tiered identity matching (
phone_and_domain_match>phone_match>domain_match>exact_name_match) for matching a known business/outlet against scraped candidates. - Review scraping with owner-response filtering, "see more" text expansion, and multilingual review-tab detection.
- Thread-based fan-out helpers (
chunk_items,run_chunked) for running multiple browser workers over a batch of items.
Status: pre-1.0 (
0.x). Extracted from duplicated scraping code across several internal projects; the API may still move before1.0.0.
Using this from another project (agent or human)? Read skills/SKILL.md first — it covers the API surface, matching semantics, parallel fan-out, and how to add this as a dependency before PyPI publication.
Install
Not yet published to PyPI. Add it as a uv path dependency — see skills/SKILL.md for the exact pyproject.toml snippet — then:
uv run playwright install --with-deps chromium
Quickstart
from gmbscraper import BusinessIdentity, OutletIdentity, google_maps_browser
with google_maps_browser() as maps:
# Search + adaptive pagination
links = maps.search_places_adaptive("plumbers", latitude=-33.87, longitude=151.21)
# Scrape a single place page
place = maps.scrape_place(links[0].maps_url, fallback_name=links[0].fallback_name)
print(place.name, place.rating, place.review_count)
# Find the Google Business Profile for a known business
match = maps.search_and_match(
OutletIdentity(name="Acme Plumbing", phone="0400 000 000", address="1 Main St, Sydney"),
BusinessIdentity(name="Acme Plumbing Pty Ltd", website="acmeplumbing.com.au"),
)
if match:
print(match.match_reason, match.place_id)
# Scrape reviews
reviews = maps.scrape_reviews(place.maps_url, max_reviews=50)
Design notes
- Every network-facing function swallows and skips broken selectors rather
than raising — a
PlaceProfileis returned with whatever fields could be read, since Google's DOM/markup changes without notice and partial data is usually more useful than a hard failure.scrape_reviewsis the exception: it raisesGoogleReviewsUnavailableErrorwhen Google serves a page with no reviews UI at all (throttled/limited view, or the reviews tab never opens), since a caller needs to distinguish "zero reviews" from "couldn't scrape." - There's no retry/backoff or proxy rotation built in. This is a DOM scraper, not a hosted anti-block service — for scraping at a scale where blocking is routine, a paid API (Outscraper, SerpApi, etc.) will be cheaper than building that infrastructure yourself.
Development
uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .
See skills/references/development.md for what is and isn't covered by the test suite.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gmbscraper-0.1.0.tar.gz.
File metadata
- Download URL: gmbscraper-0.1.0.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bf8a82a1337daaf79776c67ea3aa21bc88c452ec5b530d877d345438683c4ea
|
|
| MD5 |
747d46dda30fb24cea68aa69ff45d5d4
|
|
| BLAKE2b-256 |
dbd322b615bb6fd0724a95c7f90046ae797c4aa9ef8b1adfb89c00b00f45d4ed
|
File details
Details for the file gmbscraper-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gmbscraper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41d62678790b8255e6d65a4c140f8c52f3625d6d406dc86c4a2d736d36fc7c5e
|
|
| MD5 |
2f8cb115d08586348a35499b5457fa98
|
|
| BLAKE2b-256 |
842226a40936b8c5241e36c7ef334fbe333f3780d5a2218d393045fb516a1a06
|