Emailator is a strong email extractor python code block which can extract email adresses from a website or a list of URLS.
Feel free to use it in your program.
Emailator is a strong email extractor python code block which can extract email adresses from a website or a list of URLS.
Feel free to use it in your program.
original_url = input('Enter The Url You Want To Emailate: ') | |
import re | |
import requests | |
from urllib.parse import urlsplit | |
from collections import deque | |
from bs4 import BeautifulSoup | |
unscraped = deque([original_url]) | |
scraped = set() | |
emails = set() | |
while len(unscraped): | |
url = unscraped.popleft() | |
scraped.add(url) | |
parts = urlsplit(url) | |
base_url = "{0.scheme}://{0.netloc}".format(parts) | |
if '/' in parts.path: | |
path = url[:url.rfind('/')+1] | |
else: | |
path = url | |
# print("Datalating %s" % url) | |
try: | |
response = requests.get(url, timeout=20) | |
except (requests.exceptions.MissingSchema, requests.exceptions.ConnectionError): | |
#return 'no' | |
continue | |
new_emails = set(re.findall(r"[a-z0-9\.\-+_]+@[a-z0-9\.\-+_]+\.com", response.text, re.I)) | |
emails.update(new_emails) | |
soup = BeautifulSoup(response.text, 'lxml') |
A fast but fairly strong Email Extractor which will extract email from any website you want to scrape from.
You can use this block or make a function with this block to extract from a list of websites/Urls