Google Maps lead generation with Apify & email extraction for Airtable
π§ What It Does This n8n workflow collects leads from Google Maps, scrapes their websites via direct HTTP requests, and extracts valid email addresses β all while mimicking real user behavior to improve scraping relia...
Template notes
π§ What It Does This n8n workflow collects leads from Google Maps, scrapes their websites via direct HTTP requests, and extracts valid email addresses β all while mimicking real user behavior to improve scraping reliability. It rotates User-Agent headers, introduces randomized delays, and refines URLs by removing only query parameters and fragments to preserve valid page paths (like social media links). The workflow blends Apify actors, raw HTTP requests, HTML-to-Markdown conversion, and smart email extraction to deliver clean, actionable lead data β ready to be sent to Airtable, Google Sheets, or any CRM. Perfect for lean, scalable B2B lead generation using n8nβs native logic and no external scrapers.
π‘Why this workflow Modest lead scrapers rely on heavy tools or APIs like Firecrawl. This workflow: - Uses lightweight HTTP requests (with randomized user-agents) to scrape websites. - Adds natural wait times to avoid rate limits and IP bans. - Avoid full-page crawlers, yet still pulls emails effectively. - Works great for freelancers, marketers, or teams targeting niche B2B leads. - Designed for stealth and resilience.
π€ Who itβs for - Lead generation freelancers or consultants. - B2B marketers looking to extract real contact info. - Small businesses doing targeted outreach. - Developers who want a fast, low-footprint scraper. - Anyone who wants email + website leads from Google Maps.
βοΈ How It Works 1. π₯ Form Submission (Lead Input) A Form Trigger collects: - Keyword - Location - No. of Leads (defaults to 10)
This makes the workflow dynamic and user-friendly β ready for multiple use cases and teams.
2. π Scrape Business Info (via Apify) - Apifyβs Google Maps Actor searches for matching businesses. - The Dataset Node fetches all relevant business details. - A Set Node parses key fields like name, phone, website, and category. - A Limit Node ensures the workflow only processes the desired number of leads.
3. π First Loop β Visit & Scrape Website Each business website is processed in a loop. - A Code Node cleans the website URL by removing only query parameters/fragments β keeping full paths like /contact. - A HTTP Request Node fetches the raw HTML of the site: - Uses randomized User-Agent headers (5 variants) to mimic real devices and browsers. This makes requests appear more human and reduces the risk of detection or blocking. - HTML is converted to Markdown using the Markdown Node, making it easier to scan for text patterns. - A Wait Node introduces a random delay between 2-7 seconds: - Helps avoid triggering rate limits, - Reduces likelihood of being flagged as a bot. - A Merge Node combines scraped markdown + lead info for use in the second loop.
4. π Second Loop β Extract Emails In this second loop, the markdown data is processed. - A Code Node applies regex to extract the first valid email address. - If no email is found, "N/A" is returned. - A brief 1 second Wait Node simulates realistic browsing time. - Another Merge Node attaches the email result to the original lead data.