Git Product home page Git Product logo

scrape-emails-from-websites's Introduction

Email Scraper

This Python-based email scraper extracts email addresses from websites listed in a CSV file. It uses the Playwright library to interact with web pages and locate email addresses on both the main page and designated contact pages.

Features

  • Scrapes email addresses from the main page of a website.
  • Follows and scrapes contact pages linked from the main page.
  • Converts relative URLs to absolute URLs.
  • Logs errors to error_log.txt for troubleshooting.
  • Saves results to a new CSV file with an additional 'Email' column.

Prerequisites

  • Python 3.10
  • Google Chrome or Chromium browser

Installation

  1. Clone the repository:

    git clone https://github.com/r7avi/Scrape-Emails-from-Websites.git
    cd email-scraper
    
  2. Set up a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
    
  3. Install required packages:

    pip install -r requirements.txt
    
    
  4. Download and install Google Chrome or Chromium:

    Ensure you have Google Chrome or Chromium installed. The script uses Playwright's Chromium driver by default but you can specify the path to Chrome if needed.
    
  5. Run the script:

    python email-scrapper.py
    
  6. Select a CSV file:

    A file dialog will prompt you to select a CSV file containing website URLs. Ensure the CSV file has a column named Website.
    
  7. Review results:

    The script will process each website, extract email addresses, and save the results to a new CSV file with an added Email column.
    
    

Error Logging

Errors encountered during the scraping process are logged in error_log.txt. Review this file for troubleshooting any issues.

scrape-emails-from-websites's People

Contributors

r7avi avatar jbeliamenallah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.