A powerful web scraping tool built with Scrapy to extract email addresses from websites efficiently and ethically.
Ever needed to collect contact information from multiple websites for legitimate business purposes? Email Scraper automates this process using Python and Scrapy, crawling through web pages to find and extract email addresses. Perfect for researchers, marketers, and data analysts who need to gather public contact information at scale.
- Smart Crawling - Intelligently navigates through website structures to find email addresses
- Pattern Recognition - Uses advanced regex patterns to identify valid email formats
- Scalable Architecture - Built on Scrapy, one of the most powerful scraping frameworks
- Customizable - Easily configure domains, depth limits, and crawl rules
- Export Options - Save results in various formats (CSV, JSON, TXT)
- Respectful Scraping - Includes rate limiting and robots.txt compliance
- Python 3.13 - Modern Python for optimal performance
- Scrapy 2.12+ - Industrial-strength web scraping framework
- Twisted - Asynchronous networking engine
- beautifulsoup4 - HTML parsing when needed
- regex - Advanced pattern matching for emails
Make sure you have Python 3.8 or higher installed on your system.
-
Clone or download this repository
cd EmailScraper -
Create and activate a virtual environment
# On Windows python -m venv venv .\venv\Scripts\activate # On macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies
pip install scrapy pip install -r requirements.txt
-
Navigate to the Scrapy project directory
cd EmailScraperWeb -
Run the spider
scrapy crawl EmailScrape -o emails.csv
-
Check your results The scraped emails will be saved in
emails.csvin your current directory.
You can customize the scraping behavior by modifying the spider settings:
- Change output format: Use
-o emails.jsonor-o emails.txt - Set crawl depth: Modify
DEPTH_LIMITinsettings.py - Adjust politeness: Configure
DOWNLOAD_DELAYto be respectful to servers - Filter domains: Edit allowed domains in the spider file
EmailScraper/
├── EmailScraperWeb/ # Main Scrapy project
│ └── EmailScraperWeb/
│ ├── spiders/ # Spider definitions
│ │ └── EmailScrape.py
│ ├── settings.py # Scrapy configuration
│ └── __init__.py
├── venv/ # Virtual environment
├── .gitignore # Git ignore rules
└── README.md # You are here!
- Always respect website Terms of Service
- Check and comply with robots.txt
- Don't overload servers with requests
- Only scrape publicly available information
- Comply with GDPR, CAN-SPAM, and other data protection laws
- Set reasonable delays between requests (1-2 seconds minimum)
- Limit concurrent requests to avoid server overload
- Use a user agent that identifies your scraper
- Keep logs of what you've scraped and when
- Store data securely and delete it when no longer needed
Spider not found?
- Make sure you're in the correct directory (
EmailScraperWeb) - Check that your spider file exists in the
spiders/folder
No emails found?
- The target website might use JavaScript rendering
- Emails might be obfuscated or protected
- Check your regex patterns are correct
Import errors?
- Ensure your virtual environment is activated
- Reinstall dependencies with
pip install -r requirements.txt
Edit EmailScraperWeb/EmailScraperWeb/settings.py:
# Be polite - wait between requests
DOWNLOAD_DELAY = 2
# Identify yourself
USER_AGENT = 'EmailScraper (+http://yourwebsite.com)'
# Respect robots.txt
ROBOTSTXT_OBEY = True
# Limit crawl depth
DEPTH_LIMIT = 3- Add duplicate email detection
- Implement database storage
- Create GUI interface
- Add email validation API integration
- Support for JavaScript-heavy sites
- Export to Excel format
- Add scheduling capabilities
Found a bug? Have an idea? Contributions are welcome! Feel free to:
- Open an issue
- Submit a pull request
- Suggest new features
New to web scraping? Check out:
This project is intended for educational and legitimate business purposes only. Users are responsible for ensuring their use complies with all applicable laws and regulations.
Built with 💻 by Praashon Gautam
Remember: With great scraping power comes great responsibility. Always scrape ethically!