HOME EXPERIENCE PROJECTS & AI PHOTOGRAPHY ABOUT
← PROJECTS & AI

GOOGLE MAPS LEAD SCRAPER

Finds local businesses on Google Maps, crawls their websites for email addresses, and sends personalised outreach emails via Gmail. Built for finding headshot photography clients.

PYTHON PLAYWRIGHT GMAIL API AUTOMATION LEAD GEN

How It Works

  1. Scrape

    Playwright automates Google Maps, searches for businesses matching your query, and saves each result — name, category, address, phone, and website — to an .xlsx file.

  2. Crawl

    For each business with a website, a crawler visits the page and hunts for contact email addresses. It prioritises generic addresses (info@, contact@) over personal names and only returns addresses on the same domain.

  3. Review

    Open the .xlsx, delete any rows you don't want to contact, and save. The Send To column is pre-populated with the best email found — edit any cell to override.

  4. Send

    The email sender reads the spreadsheet, skips anyone already in the history log, and sends a personalised email via Gmail for each remaining row — stamping each row with a sent timestamp on completion.

Quick Start

  1. Scrape leads

    python3 main.py

  2. Review

    Open the .xlsx, delete rows you don't want, save and close.

  3. Send emails

    python3 email_sender.py

Project Files

File Purpose
main.py Scrapes Google Maps → saves leads to .xlsx
email_sender.py Reads .xlsx → sends emails via Gmail
maps_scraper.py Playwright browser automation
website_crawler.py Email finder for business websites
email_template.txt Your email subject, body, and signature
sent_history.csv Auto-created. Permanent log of every email sent
gmail_config.txt Auto-created. Stores Gmail credentials

Email Template

Edit email_template.txt to change what gets sent. Available placeholders:

Placeholder Example output
{Business Name} Smith & Jones LLC
{Name} Smith & Jones (legal suffix stripped)

Notes

  • Deduplication: Every successful send is logged to sent_history.csv. Future runs check this file and skip any address already contacted, regardless of which .xlsx you're running.
  • Gmail setup: Requires a Gmail App Password on first run — generate one at Google Account → Security → 2-Step Verification → App Passwords.
  • Send limits: Keep runs under 100 emails/day to stay within Gmail's sending limits.
  • Debugging: Run with --show-browser if the scraper returns no results — this opens a visible browser window for debugging or CAPTCHA solving.