This project integrates an open-source JavaScript scraper with a Python script to automate data extraction from Google Maps using Selenium. The tool is designed to efficiently gather information such as names, addresses, and ratings of restaurants and cafes. By automating the scraping process, the project simplifies data collection for analysis and research, ensuring reliable performance with robust error handling.
To set up the automated Google Maps scraper, follow these steps:
Python
Make sure you have Python installed on your system. You can download it from here
Google Chrome
Ensure you have the latest version of Google Chrome installed from here.
- First, clone the repository to your local machine using the following command:
git clone https://github.com/Omar88magdy/Automated-google-maps-scraping-
- Download chrome driver that matches you chrome version
cd Downloads
ls Downloads
- Navigate to the directory
cd Automated-google-maps-scraping-
- Install the required packages
pip install -r requirements.txt
-
Change
chrome_driver_path
variable to the location forchrome driver
-
Open
script.py
and modify thesearch_query
variable then run the script
python script.py
Walkthrough the usage:
- After running the script directly chrome will open and googlemaps will start searching by your search query
- Search results will start showing up and the automated scrolling will start scrolling
- A
google_maps_data.csv
file will be generated in the directory containing the scraped data
- A
search_query.xlsx
file will be generated after doing some cleaning and renaming procedures
containing
- Name
- Review stars rating
- Reviews count
- Google maps url
- location(lat, lon)
link for Extension
Omar Magdy - Linkedin - [email protected]