If you are looking for a way to automate the process of gathering email addresses from any website, this guide is for you. Using AI-powered tools like n8n and Firecrawl, you can build an AI-powered automation that scrapes email addresses from a website’s pages and outputs them in a clean, usable format for later processing.
This approach is perfect for lead generation, cold outreach, or any task that requires collecting contact information at scale.
Before diving in, consider joining our AI Automation Mastery community. There, you can download the full n8n automation template and all the prompts used in this workflow completely for free.
How AI Can Scrape Emails from Any Website
Manually searching through websites to find email addresses is tedious and time-consuming. This is where AI automation excels. By combining n8n, an automation tool, with Firecrawl’s powerful web scraping API, you can automate this process end-to-end.
Here’s how it works:
- You provide the homepage URL of the website you want to scrape.
- The automation crawls through multiple pages of the site, following links and filtering relevant pages.
- It extracts email addresses it finds on those pages using AI-powered extraction logic.
- The results are cleaned up and output in a simple list ready for use.
This method saves countless hours and avoids the errors of manual scraping. Plus, it scales to websites of any size.

Step 1: Mapping the Website Pages
The first critical step in this automation is to figure out which pages on the website to scrape. Firecrawl’s /map endpoint is designed for this. You provide the homepage URL, and it quickly returns a list of URLs found on the site.
This mapping is essential because email addresses can be scattered across various pages — such as “About Us,” “Team,” or “Contact” pages. Instead of scraping every single page on the site, which can be resource-heavy and costly, the automation uses a search filter to find pages related to people or contact information.
For example, the search parameter might include terms like about, contact, company, authors, and team. This filtering narrows down the pages to just those most likely to contain email addresses, improving speed and reducing API credit usage.
When setting this up, you specify:
- URL: The homepage URL you want to map.
- Limit: The maximum number of pages to fetch. Adjust this based on website size and your API credit budget.
- Search: Keywords to filter pages that are relevant to finding email addresses.
This step transforms the starting URL into a focused list of URLs to target for email extraction.
Step 2: Batch Scraping Email Addresses
After mapping the relevant pages, the next step is to scrape those pages for email addresses. Firecrawl’s /batch/scrape endpoint enables scraping multiple URLs in a single job.
You pass the list of URLs from the mapping step to this endpoint along with instructions on what data to extract. The key here is the prompt that instructs Firecrawl’s AI to:
- Extract every unique, fully qualified email address found on the pages.
- Handle common obfuscations used to hide emails from bots.
- Normalize and clean the extracted data, converting close matches into valid email addresses.

You can also request the output in different formats. Markdown is useful for readability and debugging, while JSON is perfect for structured data processing within your automation.
Step 3: Checking Scrape Status and Collecting Results
Scraping multiple pages can take time, especially for larger websites or higher page limits. To manage this, the automation includes a loop that periodically checks the status of the scraping job.
This loop works by:
- Waiting a few seconds between status checks to avoid hitting rate limits.
- Polling Firecrawl’s API to see if the job is completed, pending, or processing.
- Repeating the check up to a maximum number of attempts (e.g., 12 times) before timing out and throwing an error.

Once the scraping is complete, the automation collects the results and consolidates all email addresses into a single clean list. This involves filtering out duplicates and empty values to ensure your final output is ready for immediate use.
Step 4: Using the Scraped Emails for Cold Outreach
Scraping emails is just the start. To turn these contacts into leads, you need to automate your outreach. Integrating with a cold email platform like Instantly AI can help you do this without manual effort.
Instantly AI is an AI-enabled cold email tool that simplifies sending sequences, warming up email addresses, and managing replies in one centralized inbox. This makes scaling cold email campaigns easier and more organized.

Here’s how you can extend your email scraping automation to include outreach:
- Split the list of scraped emails into individual items.
- For each email, create a lead in Instantly AI using its API.
- Enroll each lead into a pre-configured drip email campaign.
The drip campaign typically includes:
- An initial personalized email congratulating or engaging the lead.
- A follow-up pitch explaining your offer or product.
- A final call-to-action email to encourage a response.
Instantly AI handles scheduling emails during business hours, sending follow-ups automatically, and routing replies to a unified inbox for easy management.

Customizing the Automation for Your Needs
This automation is highly flexible. You can adjust parameters such as:
- Page limit: Control how many pages to crawl to balance thoroughness and API usage.
- Search keywords: Tailor the page filtering to target specific sections of a website.
- Email extraction prompt: Modify the AI extraction logic for different data or formats.
- Integration targets: Instead of Instantly AI, you could push scraped emails to other CRMs, marketing tools, or databases.
This flexibility allows you to build automations that fit your unique workflow or client requirements.
Conclusion
Using AI tools such as n8n and Firecrawl, you can create a powerful automation that scrapes email addresses from any website efficiently. By mapping relevant pages, batch scraping emails, and integrating with cold email platforms like Instantly AI, this workflow covers the full process from data gathering to lead engagement.
If you would like to download this automation completely for free, be sure to join our community AI Automation Mastery. You'll get access to both automation and our entire library of n8n automations.