Download the zip, unzip it into your Claude Code project folder, and you're ready to go. Claude reads the instructions automatically and sets everything up for you.
After downloading:
python scrape.py "dentists" "Tampa, FL"💡 The INSTRUCTIONS.md file is the magic. When you tell Claude to read it, it and knows exactly what to do. It'll make the search function work with real data, set up Google Sheets if you want, and walk you through everything.
⚠️ Do lesson 5.9 first. You need to understand the manual process before automating it. If you haven't done 5.9 yet, go back and do it. Automation without understanding is a mess.
You're going to ask Claude Code to build you a tool. Here's what the tool does:
Open Claude Code and paste this prompt. Claude will build the entire scraping tool for you.
Build me an automated lead scraping tool for my ad agency. Here's exactly what I need:
1. A Python script called scrape.py that takes two arguments: a niche and a city
Example usage: python scrape.py "dentists" "Tampa, FL"
2. The script should:
- Search the web for 50 businesses matching that niche and city
- For each business, collect: name, phone number, website URL, address, Google rating, number of reviews, whether they have a Facebook page
- Check the Meta Ad Library to see if each business is running Facebook/Instagram ads
- Score each prospect 1-5:
* 5 = running ads that look low quality (easiest to close)
* 4 = running ads, decent quality
* 3 = has Facebook page but no ads
* 2 = no Facebook page but good reviews (3.5+ stars)
* 1 = no online presence
- Filter out businesses with less than 3.5 stars or fewer than 20 reviews
- Sort by score (highest first), then by rating
3. Output the results to Google Sheets:
- Connect to Google Sheets API using a service account
- Create a new tab named "[City] - [Niche] - [Date]"
- Columns: Score, Business Name, Phone, Website, Address, Rating, Reviews, Facebook Page, Running Ads, Number of Ads, Ad Quality Notes, Outreach Date, Response, Notes, Follow-Up Date
- Format the header row bold with a light blue background
- Auto-resize columns to fit content
- Also save a local CSV backup in a prospects/ folder
4. Include a README with:
- How to set up Google Sheets API credentials (step by step for beginners)
- How to run the script
- How to change the Google Sheet ID
5. Include a requirements.txt with all dependencies
Make sure the script handles errors gracefully. If it can't find info for a business, leave that field blank instead of crashing. Print progress to the terminal so I can see it working.
Create everything in a folder called lead-scraper/
Screenshot will be added here
💡 Claude builds the whole thing. You don't need to write any code. Claude creates the script, the README, the requirements file, everything. You just paste the prompt and let it work.
The script needs permission to write to your Google Sheet. Claude's README will walk you through this, but here's the overview:
Go to sheets.google.com and create a new spreadsheet. Name it something like "Agency Prospects". Copy the Sheet ID from the URL (the long string of letters and numbers between /d/ and /edit).
Go to console.cloud.google.com. Create a project, enable the Google Sheets API, and create a service account. Download the JSON key file.
If this sounds confusing, don't worry. Just tell Claude Code:
Walk me through setting up Google Sheets API credentials step by step. I'm a complete beginner. Tell me exactly what to click.
Share your Google Sheet with the service account email (it looks like something@your-project.iam.gserviceaccount.com). Give it Editor access.
Open the config file Claude created and paste your Sheet ID. That's it. The script now has permission to write to your spreadsheet.
Screenshot will be added here
Install the dependencies and run it:
cd lead-scraper pip install -r requirements.txt python scrape.py "dentists" "Tampa, FL"
You'll see progress in the terminal as it finds businesses, checks the Ad Library, and scores each one. When it's done, open your Google Sheet. Fresh tab with all your prospects.
More examples:
python scrape.py "HVAC companies" "Phoenix, AZ"
python scrape.py "med spas" "Miami, FL"
python scrape.py "gyms" "Austin, TX"
python scrape.py "roofing contractors" "Dallas, TX"
💡 Run it for multiple niches. Each run creates a new tab in your Google Sheet. By the end of the week you could have 200+ prospects across 4 different niches, all scored and organized.
Want it to run every Monday morning automatically? Ask Claude Code:
Set up a weekly schedule so my lead scraper runs automatically every Monday at 8 AM. I want it to scrape these niches and cities: 1. "dentists" in "Tampa, FL" 2. "HVAC companies" in "Tampa, FL" 3. "med spas" in "Tampa, FL" Each one should create a new tab in my Google Sheet. Send me a notification when it's done (email or Slack or Discord, whatever is easiest to set up).
Claude will set up a cron job (Mac/Linux) or Task Scheduler (Windows) to run the script on a schedule. You wake up Monday morning with 150 fresh prospects in your Google Sheet.
⚠️ Your computer needs to be on. The schedule runs on your machine. If your laptop is closed Monday morning, it won't run. If that's a problem, ask Claude to set it up on a free cloud service instead (like a GitHub Action or a small server).
The automation gets you the list. YOU still do the outreach. That's where the money is.
🛑 Don't automate the outreach. Scraping is fine to automate. Outreach is not. Personalized messages from a real person convert. Mass-blasted AI messages get ignored and can get your accounts flagged.
Just ask Claude Code to fix it. Copy the error and paste it:
I ran the scraper and got this error: [paste the error here] Fix it and explain what went wrong.
Common issues:
"Google Sheets permission denied"
You forgot to share the sheet with the service account email. Go back to Step 2.
"Module not found"
Run pip install -r requirements.txt again. A dependency didn't install.
"Rate limited" or "Too many requests"
You're searching too fast. Tell Claude to add a delay between searches (2-3 seconds per business).
"Script found 0 businesses"
Your niche or city might be too specific. Try a broader search ("restaurants" instead of "Italian restaurants") or a bigger city.