Interactive Google Maps scraper with Tkinter confirmation
Project description
gmaps-scraper
Interactive Google Maps scraper with Tkinter confirmation
gmaps-scraper lets you visually pick locations in Google Maps and captures the place name, coordinates, address, city, state, country, plus any custom fields you specify. Each pick pops up a dialog so you can review or add extra info before recording.
Features
- Live map interaction via Selenium & Chrome
- Automatic extraction of:
- Place name
- Latitude & longitude
- Full address
- City, state, country (via Plus code)
- Rating, Reviews, Category
- Batch mode: if you supply
search_terms, it will run exactly those searches and return immediately (no “Keep going?” prompt) - Manual mode: if you omit
search_terms, after each scrape you’re asked “Keep going?” - Custom fields: define required
*or optional fields in your dialog - Confirmation modes:
always: always prompt after each scrapeon_missing: prompt only if any field (required or optional) is blankon_required_missing: prompt only if a required field is blank
- Clean teardown of browser sessions
Installation
pip install gmaps-scraper
Usage
Basic pick
from gmaps_scraper import get_google_map_details
# Launch the map picker; no extra fields
data = get_google_map_details()
print(data)
# => {("40.785091","-73.968285"): {"name": "Central Park", "latitude": "...", ...}}
With search term (batch mode; no “Keep going?”)
from gmaps_scraper import get_google_map_details
data = get_google_map_details(search_terms=["Empire State Building", "Central Park"])
print(data)
With custom fields
from gmaps_scraper import get_google_map_details
data = get_google_map_details(
additional_required=['Contact', 'Phone'],
additional_optional=['Notes']
)
print(data)
With confirmation modes
from gmaps_scraper import get_google_map_details
# Only prompt if any field is missing
data = get_google_map_details(confirmation_mode="on_missing")
print(data)
# Only prompt if a required field is missing
data = get_google_map_details(confirmation_mode="on_required_missing")
print(data)
In the confirmation dialog box:
- Fields ending with
*are required—the dialog won’t proceed until you fill them when prompting. - Optional fields can be left blank.
- Control prompts using
confirmation_mode.
API Reference
get_google_map_details(
additional_required: List[str] = None,
additional_optional: List[str] = None,
search_terms: List[str] | str = None,
confirmation_mode: Literal["always", "on_missing", "on_required_missing"] = "always",
debug: bool = False
) -> Dict[Tuple[str, str], Dict[str, str]]
- additional_required: list of field names that must be filled before proceeding
- additional_optional: list of field names that may be left blank
- search_terms: term or list of terms to enter into Google Maps search bar
- confirmation_mode: when to show the confirmation dialog; one of:
"always": always prompt (default)"on_missing": prompt only if any field (required or optional) is blank"on_required_missing": prompt only if a required field is blank
- debug: if
True, prints debug logs for URL changes and scraped values
License
MIT © Kanad Rishiraj (RoamingSaint)
Project details
Release history Release notifications | RSS feed
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 gmaps_scraper-0.4.2.tar.gz.
File metadata
- Download URL: gmaps_scraper-0.4.2.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12453d4c22e9a97ea5dd926da4bac436d8666403d1f528dc921d34b2bb12659b
|
|
| MD5 |
84b97bbef34083d2092b402c48c9498b
|
|
| BLAKE2b-256 |
359e018db5c8353b445da526306ef648ff2162c3303eea2fa52861908705dbbe
|
File details
Details for the file gmaps_scraper-0.4.2-py3-none-any.whl.
File metadata
- Download URL: gmaps_scraper-0.4.2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df6afb5fef4ae87394e20ccc679b071faffa9ccd99acf373988c51594d9215b6
|
|
| MD5 |
951639b7476f947251dfa2907d191920
|
|
| BLAKE2b-256 |
7b966375aa928e02560c2dd35eb4a9a982d5f1bf86aee8408b3857d9d6acaedb
|