Skip to content

xbuddhi/google-maps-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Maps Scraper & Viewer

Overview

This project allows you to scrape business details from Google Maps (including Open Hours and Popular Times) and view the results in a nice web interface.

Prerequisites

  • Python 3.8+
  • PHP 7.4+ (for the viewer)
  • Google Chrome (for Playwright)

Quick Start

macOS

# Make script executable and run
chmod +x run.sh
./run.sh

This will:

  • Set up a Python virtual environment
  • Install all dependencies
  • Start the PHP web server
  • Open your browser to the interface
  • Provide instructions for running the scraper

Windows/Linux

# Create virtual environment
python -m venv .venv

# Activate (Windows)
.venv\Scripts\activate
# Or (macOS/Linux)
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt
playwright install chromium

# Start PHP server
php -S localhost:8000

# Run scraper (in another terminal)
python scraper.py "restaurants near arugambay"

Usage

Running the Scraper

# Activate virtual environment first
source .venv/bin/activate  # macOS/Linux
# or
.venv\Scripts\activate     # Windows

# Run with your query
python scraper.py "your search query"

Results are saved in scrapings/query_name/timestamp.json.

Viewing Results

The web interface provides:

  • Browse all scraped places
  • Search and filter results
  • Follow/unfollow places
  • View detailed information

Features

  • Deep Scraping: Extracts Name, Address, Phone, Website, Ratings, Reviews, Weekly Open Hours, and Popular Times
  • Infinite Scroll: Automatically scrolls to find all results
  • Parallel Processing: Uses async Playwright for speed
  • Clean Interface: Bootstrap-based viewer with search functionality
  • Follow System: Mark places you're interested in

Project Structure

├── scraper.py          # Main scraping script
├── index.php           # Web interface
├── run.sh             # macOS setup script
├── requirements.txt    # Python dependencies
├── .gitignore         # Git ignore rules
└── scrapings/         # Scraped data (auto-generated)

Deployment

To host this online:

  1. Upload to your web server
  2. Ensure scrapings/ folder is writable
  3. Point your domain to the folder
  4. Access via browser

License

MIT License - feel free to use and modify.

About

Google Maps Scraper with PHP frontend - scrape business details and view results in a web interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors