A Python-based scraper for extracting detailed listing data from Google Maps. The scraper gathers a variety of information about businesses or listings while using rotating user agents to bypass Google's anti-scraping mechanisms.
The scraper extracts the following data fields from Google Maps listings:
- Job Title: The title or name of the business or job.
- Photo and Images: URLs or paths to images related to the listing.
- Job Group/Category: The type or category of the listing (e.g., Restaurant, Store, etc.).
- Location: Latitude and longitude coordinates of the listing.
- Phone Number: Contact number associated with the listing.
- Hours and Days of Operation: Business hours and operating days.
- Website: Official website URL of the listing.
- Text Address: Full textual address of the listing.
-
Clone this repository:
git clone [email protected]:AmirEspahbodi/google-map-scraper.git cd [email protected]:AmirEspahbodi/google-map-scraper.git
-
Install the required Python dependencies:
poetry install poetry env use python3.13
The scraper works by targeting specific cities and job titles. You must define the target city and job title in the src/run.py
file before running the scraper. For example:
- Markets in London
- Bars in Houston
-
Open the
src/run.py
file in your text editor or IDE. -
Locate the section where the target city and job title are defined.
-
Edit the file to include your desired search query. Example:
city = "London" place_title = "markets"
-
Save the file after making the changes.
-
Run the scraper:
cd src python run.py
-
The scraped data will be saved to a file in your preferred format (e.g., CSV, JSON, etc.).
To scrape data for markets in London, set the following in src/run.py
:
city = "London"
place_title = "markets"
Run the script, and the scraper will gather data specific to this query.
This scraper uses the following techniques to avoid detection and bypass Google's blockers:
- Rotating User Agents: The scraper frequently changes the User-Agent header to mimic different devices and browsers.
- Request Rate Limiting: To prevent triggering anti-scraping mechanisms, the scraper includes delays between requests.
This tool is intended for educational and personal use only. Scraping Google Maps may violate their terms of service. Use this scraper responsibly and at your own risk.
This project is licensed under the MIT License. See the LICENSE
file for more details.
Contributions are welcome! Feel free to fork the repository and submit pull requests.
For any issues or suggestions, please open an issue or contact the developer directly.