Jul 13, 2025 08:08 AM
(This post was last modified: Jul 14, 2025 10:34 PM by The Joker.)
Hello folks!
I made a python scraper to scrape business leads from Google maps and have been using it for quite some time. Thought of giving it away for the members of this forum.
DESCRIPTION
This Python script provides a graphical user interface (GUI) for scraping business information from Google Maps. It allows users to input a search keyword and a list of city names from a CSV file. The script then automates a Chrome browser (which will be visible and positioned next to the GUI) to search Google Maps for businesses matching the keyword in each specified city, extract details like business name, address, contact information, and website, and save the data to a CSV file. It also includes features for resuming scraping, displaying real-time progress and errors, and opening the scraped data file directly from the GUI.
Key Features
GUI for Easy Input: User-friendly interface for keyword, city CSV, and Chromedriver path.
Business Information Extraction: Scrapes details such as Name, Stars, Review Count, Business Type, Address, Contact numbers, and Website.
Resume Capability: Skips already-scraped businesses on subsequent runs.
Real-time Feedback: Displays current task, city progress (progress bar), and any encountered errors.
Visible Browser: The Chrome browser window is displayed and positioned next to the GUI, allowing you to observe the scraping process.
Optimized Loading: Configured to disable image loading and other unnecessary elements in the browser for faster page loads.
Open Scraped Data: A button to directly open the generated CSV file.
Installation
To use this script, you need to have Python installed on your system, along with several Python libraries and the Chrome WebDriver.
1. Install Python:
2. Install Python Libraries:
3. Download Chromedriver:
How to Run the Script
1. Save the Code:
2. Prepare Your City Names CSV File:
3. Launch the Application:
On Windows:
On macOS/Linux:
(Use python instead of python3 if that's how your system's default Python 3 is aliased).
4. Use the GUI:
The script will save the scraped data to a CSV file named google_maps_scraped_data.csv in the same directory where you run the script.
Video of the script in action:
Spoiler (Click to View)
Scraped Data will be in the following format:
Name|Stars|Review_Count|Biz_Type|Address|Contact1|Contact2|Contact3|Website|Source_URL
Example:
![[Image: Screenshot-2025-07-15-110122.png]](https://i.postimg.cc/HLFvHSKM/Screenshot-2025-07-15-110122.png)
![[Image: Divider.png]](https://i.postimg.cc/63C7ndyH/Divider.png)
![[Image: Divider.png]](https://i.postimg.cc/63C7ndyH/Divider.png)
I made a python scraper to scrape business leads from Google maps and have been using it for quite some time. Thought of giving it away for the members of this forum.
DESCRIPTION
This Python script provides a graphical user interface (GUI) for scraping business information from Google Maps. It allows users to input a search keyword and a list of city names from a CSV file. The script then automates a Chrome browser (which will be visible and positioned next to the GUI) to search Google Maps for businesses matching the keyword in each specified city, extract details like business name, address, contact information, and website, and save the data to a CSV file. It also includes features for resuming scraping, displaying real-time progress and errors, and opening the scraped data file directly from the GUI.
Key Features
GUI for Easy Input: User-friendly interface for keyword, city CSV, and Chromedriver path.
Business Information Extraction: Scrapes details such as Name, Stars, Review Count, Business Type, Address, Contact numbers, and Website.
Resume Capability: Skips already-scraped businesses on subsequent runs.
Real-time Feedback: Displays current task, city progress (progress bar), and any encountered errors.
Visible Browser: The Chrome browser window is displayed and positioned next to the GUI, allowing you to observe the scraping process.
Optimized Loading: Configured to disable image loading and other unnecessary elements in the browser for faster page loads.
Open Scraped Data: A button to directly open the generated CSV file.
Installation
To use this script, you need to have Python installed on your system, along with several Python libraries and the Chrome WebDriver.
1. Install Python:
- If you don't have Python installed, download it from the official website: https://www.python.org/downloads/
- During installation, make sure to check "Add Python to PATH" (especially on Windows) for easier command-line access.
2. Install Python Libraries:
- Open your terminal or command prompt.
- Run the following command to install the required libraries:
Code
pip install pandas beautifulsoup4 selenium3. Download Chromedriver:
- This script uses Selenium to control a Google Chrome browser. You need the chromedriver executable that matches your installed Google Chrome browser version.
- Go to the official Chrome for Testing availability dashboard: https://googlechromelabs.github.io/chrome-for-testing/
- Find the chromedriver version that corresponds to your Chrome browser's version. You can check your Chrome version by going to chrome://version/ in your browser.
- Download the appropriate chromedriver zip file for your operating system.
- Unzip the downloaded file. You will find an executable file named chromedriver.exe (on Windows) or chromedriver (on macOS/Linux).
- Keep note of the path to this executable. You will need to provide it in the GUI, or you can place it in a directory that is already in your system's PATH.
How to Run the Script
1. Save the Code:
- Copy the entire Python code from the "Google Maps Scraper with GUI" Canvas.
- Save it to a file named maps_scraper_gui.py (or maps_scraper_gui.pyw on Windows if you want to prevent the console window from appearing).
2. Prepare Your City Names CSV File:
- Create a simple CSV file (e.g., cities.csv) containing the names of the cities you want to scrape. Each city name should be on a new line in the first column.
- Example cities.csv content:
Code
New York
Los Angeles
Chicago
Houston3. Launch the Application:
On Windows:
- If you saved it as .pyw, you can usually just double-click the maps_scraper_gui.pyw file.
- If you saved it as .py, open Command Prompt or PowerShell, navigate to the directory where you saved the file, and run:
Code
python maps_scraper_gui.pyOn macOS/Linux:
- Open a terminal, navigate to the directory where you saved the file, and run:
Code
python3 maps_scraper_gui.py4. Use the GUI:
- A GUI window titled "Google Maps Scraper" will appear on the left side of your screen.
- Keyword: Enter the type of business you want to search for (e.g., "restaurants", "plumbers", "gyms").
- City Names CSV File: Click the "Browse" button and select the cities.csv file you created.
- Chromedriver Path (optional): If chromedriver is not in your system's PATH, click "Browse" and select the chromedriver executable you downloaded.
- Start Scraping: Click this button to begin the scraping process.
- A Chrome browser window will open on the right side of your screen and start navigating through Google Maps.
- The GUI will update with progress (cities scraped), current tasks, and any errors.
- A Chrome browser window will open on the right side of your screen and start navigating through Google Maps.
- Stop Scraping: Click this button to stop the scraping process at any time.
- Clear Settings: Clears all input fields and the saved configuration file (scraper_config.json).
- Open Scraped Data: Once scraping has started and some data is collected, you can click this button to open the google_maps_scraped_data.csv file in your system's default CSV viewer (e.g., Excel, Google Sheets).
The script will save the scraped data to a CSV file named google_maps_scraped_data.csv in the same directory where you run the script.
Video of the script in action:
Spoiler (Click to View)
Scraped Data will be in the following format:
Name|Stars|Review_Count|Biz_Type|Address|Contact1|Contact2|Contact3|Website|Source_URL
Example:
![[Image: Screenshot-2025-07-15-110122.png]](https://i.postimg.cc/HLFvHSKM/Screenshot-2025-07-15-110122.png)
![[Image: Divider.png]](https://i.postimg.cc/63C7ndyH/Divider.png)
Tagged Friends:
![[Image: Divider.png]](https://i.postimg.cc/63C7ndyH/Divider.png)
To get the script, reply to this thread with a birthday wish for 7 and tag 7 of your friends!


![[Image: support-red.png]](https://hackforums.net/images/hfnews/support-red.png)


![[Image: ezgif-5ed481b8a2df6a8e.gif]](https://i.ibb.co/zhtxRJN6/ezgif-5ed481b8a2df6a8e.gif)


