Python 3 Script to Scrape or Extract all Emails From HTML Document Using scrape_emails Library Full Project For Beginners

Python 3 Script to Scrape or Extract all Emails From HTML Document Using scrape_emails Library Full Project For Beginners

 

Welcome folks today in this blog post we will be extracting or scraping all the emails from html documents using python and scrape_emails library. All the full source code of the application will be given below.

 

 

 

Get Started

 

 

 

In order to get started you need to install the following libraries using the pip command as shown below

 

pip install tkinter

 

pip install scrape_emails

 

After installing all the libraries just make an app.py file and copy paste the following code

 

app.py

 

 

from email_scraper import scrape_emails

email = scrape_emails('<html><body><a href="mailto:hello@world.com">email me</a></body></html>')

print(email)

 

 

As you can see we are importing the library in the first line of the python code and then we are calling the library and providing the first argument as the raw html and then it will automatically extract all the emails which are present inside the html

See also  Python 3 Kivy Checkers Board Strategy Game GUI Desktop App Full Project For Beginners

 

So now when you execute the app.py file you will see the following output as shown below

 

 

 

Leave a Reply