A fast, headless web scraper that extracts all reviews from Google Maps business listings using Puppeteer with stealth mode.
- Complete Review Collection - Automatically scrolls and loads all reviews, not just the first page
- Stealth Mode - Uses puppeteer-extra-plugin-stealth to avoid bot detection
- Detailed Data Extraction - Captures reviewer names, star ratings, review text, and owner responses
- Performance Optimized - Blocks images, fonts, and media for faster execution (~40% speed improvement)
- Headless Operation - Runs in background without opening browser windows
- Easy to Use - Interactive prompt for entering any Google Maps URL
- Handles Edge Cases - Properly distinguishes between reviews with no text and owner responses
npm install
Run the scraper:
npm start
or
run "run.bat" on windows.
or
node index.js
When prompted, paste the full Google Maps URL of any business:
Enter Google Maps URL: https://maps.app.goo.gl/RvL7iSNSsNaVBRru8
(Obtained by going to google maps > Share > Link to Share)
The scraper will:
- Navigate to the business page
- Click the Reviews tab
- Automatically scroll to load all reviews
- Extract and display all review data
- Exit when complete
Review #1
Name: John Doe
Rating: 5 stars
Review: Great service! Highly recommend...
Owner Response: Thank you for your feedback!
---
Total: 338 reviews
Change headless: true
to headless: false
in the code to watch the browser in action:
const browser = await puppeteer.launch({
headless: false, // Shows browser window
// ...
});
Modify the scroll parameters for different performance characteristics:
for (let attempt = 0; attempt < 250; attempt++) { // Max scroll attempts
// ...
if (noChangeCount >= 15) { // Stop after 15 failed attempts
To run automatically every 24 hours:
Linux/Mac:
crontab -e
Add this line (runs daily at 9 AM):
0 9 * * * cd /path/to/scraper && node index.js >> reviews.log 2>&1
Windows Task Scheduler:
Create run.bat
:
@echo off
cd C:\path\to\scraper
node index.js >> reviews.log 2>&1
Then schedule it in Task Scheduler.
- Puppeteer 24.15.1 - Latest Chrome automation library
- Stealth Plugin - Evades bot detection systems
- Resource Blocking - Improves speed by blocking images/fonts/media
- Smart Scrolling - Uses PageDown keyboard events to trigger lazy loading
- Review Detection - Monitors DOM for new review elements appearing
- Node.js 14 or higher
- https://nodejs.org/en/download
- ~200MB disk space for Chromium
- Only works with public Google Maps reviews
- Google may rate-limit requests if used too frequently
- Some businesses with 1000+ reviews may take several minutes
- Requires stable internet connection
This tool is for personal use and educational purposes. Always respect Google's Terms of Service and robots.txt. Use responsibly and consider rate limiting your requests.
ISC
Pull requests welcome. For major changes, please open an issue first.