Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email Scrapper From URL #42

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Python/get-email-fromURL/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from tkinter import *
import requests
from bs4 import BeautifulSoup
import html5lib
import re
from copy import copy


window = Tk()
window.geometry('300x550')
window.title('Emails from the Link')
entry1 = StringVar()
def fetch():
try:
url = entry1.get()
r = requests.get(url)
content = r.text
soup = BeautifulSoup(content, 'html5lib')
mail_text = (soup.get_text())
eml_reg_exp = re.findall(r"[a-zA-Z0-9]+@+[a-zA-Z]+\.[a-zA-Z]+" , mail_text)
ins = ""
for value in eml_reg_exp:
ins += value+'\n'
ins2 = copy(ins)
text.config(state= "normal")
text.insert(INSERT,ins2)

except Exception:
print("No Email Found")

return fetch




Label(window,text= "Give me a Link:").grid(row= 0, column =1)

Label(window, text= "URL: ").grid(row=2 , column =0)
Entry(window,textvariable = entry1).grid(row=2, column =1)

btn = Button(window,text= "Get Email", command = fetch)
btn.grid(row =3, column =1,pady = 12)

text =Text(window,width = 29, height = 13)
text.grid(row= 5 , column= 1, pady= 3, padx= 2)


window.mainloop()
28 changes: 28 additions & 0 deletions Python/get-email-fromURL/requirments.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
altgraph==0.17
auto-py-to-exe==2.9.0
BeautifulSoup4
bottle==0.12.19
bottle-websocket==0.2.9
certifi==2021.5.30
cffi==1.14.5
chardet==4.0.0
Eel==0.12.4
future==0.18.2
gevent==21.1.2
gevent-websocket==0.10.1
greenlet==1.1.0
html5lib==1.1
idna==2.10
pefile==2021.5.24
pycparser==2.20
pyinstaller==4.3
pyinstaller-hooks-contrib==2021.1
pywin32-ctypes==0.2.0
requests==2.25.1
six==1.16.0
soupsieve==2.2.1
urllib3==1.26.5
webencodings==0.5.1
whichcraft==0.6.1
zope.event==4.5.0
zope.interface==5.4.0
2 changes: 1 addition & 1 deletion Python/get-lyrics/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ def getLyrics(title):
lyrics += i.text+'\n'
return lyrics

lyrics = getLyrics("Treat you better")
lyrics = getLyrics("Treat you better \n Thank You")
print(lyrics)