This is a Python script that allows you to scrape information from Google Maps, including business names, addresses, phone numbers, websites, ratings, and reviews. The script can be configured to search for specific queries and can scrape either the first page of results or all pages of results.
- Clone Starter Template
git clone https://github.com/omkarcloud/google-maps-scraper
cd google-maps-scraper
- Install dependencies
python -m pip install -r requirements.txt
- Run Project
python main.py
The script will start running and output progress updates to the console. When the scraper is complete, it will generate a CSV file named finished.csv
in the output
directory. The CSV file will contain the business name, address, phone number, website, rating, and review for each result.
Additionaly, you don't have to configure the Selenium driver as it will automatically download the appropriate driver based on your Chrome browser version.
-
To specify the Google search queries to be used in the scraper, open the
src/scraper.py
file in your preferred text editor and update theTask.queries
list with your desired queries. -
To specify whether to scrape the first page of Google Maps results or all pages of results, open the
src/scraper.py
file and set theTask.GET_FIRST_PAGE
variable toTrue
orFalse
as appropriate.
The Google Maps Scraper project uses the Bose Framework, a web scraping framework that is Swiss Army Knife for web scraping. I encourage you to learn about Bose Framework at https://www.omkar.cloud/bose/