Skip to content

About

A Python automation script that scrapes business listings from Google Maps and extracts useful business information.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🗺️ Google Maps Data Extractor

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.


🚀 Overview

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.


✨ Features

🔍 Automated Google Maps Search

Searches businesses using custom queries like:

"small restaurants in Raleigh, North Carolina"

You can change:

  • Business type
  • City
  • State / Country

📋 Data Extraction

Extracts:

  • Business Name
  • Website
  • Address

♻️ Duplicate Prevention

Avoids duplicate entries by tracking already saved business names.


💾 Real-Time CSV Saving

Saves results immediately to CSV so partial data is preserved if interrupted.

Example output file:

US_Small_Restaurants.csv

🤖 Browser Automation

Uses Selenium with ChromeDriver Manager to automate browser actions.


🛠️ Tech Stack

Built with:

  • Python
  • Selenium
  • Pandas
  • WebDriver Manager
  • CSV / OS / Time modules

📁 Project Structure

GoogleMapDataExtractor/
│
├── GoogleMapDataExtractor.py   # Main script
├── US_Small_Restaurants.csv    # Output file (generated)
└── README.md

⚙️ Installation

Clone the repository:

git clone <your-repo-url>
cd GoogleMapDataExtractor

Install dependencies:

pip install selenium pandas webdriver-manager

▶️ Usage

Run the script:

python GoogleMapDataExtractor.py

🔧 Configuration

You can configure the script inside the file:

Headless Mode

HEADLESS = False
  • True → runs silently
  • False → opens browser visibly

Scroll Settings

SCROLL_ROUNDS = 6

Controls how many times the Google Maps results are scrolled.


Delay Between Visits

PLACE_VISIT_DELAY = 3

Wait time before extracting listing details.


Search Queries

Edit the list:

CITY_LIST = [
    "small restaurants in Raleigh, North Carolina",
]

Examples:

"cafes in Charlotte, North Carolina"
"bakeries in New York"
"gyms in California"

📊 Output Example

CSV file format:

Restaurant Name Website Address
ABC Cafe https://abccafe.com Raleigh, NC
XYZ Bakery https://xyzbakery.com Charlotte, NC

⚠️ Notes

  • Google Maps page structure may change over time.
  • Excessive scraping may trigger rate limits or captchas.
  • Use responsibly and ethically.

🤝 Contributing

Contributions are welcome.

Possible improvements:

  • Extract phone numbers
  • Extract ratings/reviews
  • Add proxy support
  • Add multi-threading for speed

💡 Author

Malki Aman

About

A Python automation script that scrapes business listings from Google Maps and extracts useful business information.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages