A Python automation script that scrapes business listings from Google Maps and extracts useful business information such as:
- Business Name
- Website URL
- Address
This tool is ideal for lead generation, market research, and local business data collection.
The Google Maps Data Extractor automates the process of searching Google Maps for businesses in specific cities or categories.
For example:
- Small restaurants in Raleigh, North Carolina
- Cafes in Charlotte, North Carolina
- Bakeries in New York
- Salons in Los Angeles
The script opens Google Maps, scrolls through results, visits each listing, and collects business details.
Searches businesses using custom queries like:
"small restaurants in Raleigh, North Carolina"You can change:
- Business type
- City
- State / Country
Extracts:
- Business Name
- Website
- Address
Avoids duplicate entries by tracking already saved business names.
Saves results immediately to CSV so partial data is preserved if interrupted.
Example output file:
US_Small_Restaurants.csvUses Selenium with ChromeDriver Manager to automate browser actions.
Built with:
- Python
- Selenium
- Pandas
- WebDriver Manager
- CSV / OS / Time modules
GoogleMapDataExtractor/
│
├── GoogleMapDataExtractor.py # Main script
├── US_Small_Restaurants.csv # Output file (generated)
└── README.mdClone the repository:
git clone <your-repo-url>
cd GoogleMapDataExtractorInstall dependencies:
pip install selenium pandas webdriver-managerRun the script:
python GoogleMapDataExtractor.pyYou can configure the script inside the file:
HEADLESS = FalseTrue→ runs silentlyFalse→ opens browser visibly
SCROLL_ROUNDS = 6Controls how many times the Google Maps results are scrolled.
PLACE_VISIT_DELAY = 3Wait time before extracting listing details.
Edit the list:
CITY_LIST = [
"small restaurants in Raleigh, North Carolina",
]Examples:
"cafes in Charlotte, North Carolina"
"bakeries in New York"
"gyms in California"CSV file format:
| Restaurant Name | Website | Address |
|---|---|---|
| ABC Cafe | https://abccafe.com | Raleigh, NC |
| XYZ Bakery | https://xyzbakery.com | Charlotte, NC |
- Google Maps page structure may change over time.
- Excessive scraping may trigger rate limits or captchas.
- Use responsibly and ethically.
Contributions are welcome.
Possible improvements:
- Extract phone numbers
- Extract ratings/reviews
- Add proxy support
- Add multi-threading for speed
Malki Aman