Skip to content

Commit 5398c39

Browse files
committed
Added feature of retreiving email_ids and web_links
1 parent c45f80a commit 5398c39

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

torBot.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,33 @@ def readPage(page):
7676
response = urllib.request.urlopen(page)
7777
soup = BeautifulSoup(response.read(),'html.parser')
7878
print (soup.find_all('input'))
79+
return soup
80+
81+
###Get all emails from the website
82+
def get_all_emails(soup):
83+
websites = []
84+
emails = []
85+
for link in soup.find_all('a'):
86+
email_link = link.get('href')
87+
if email_link != None:
88+
if 'http' in email_link:
89+
websites.append(email_link)
90+
elif 'mailto' in email_link:
91+
emails.append(email_link)
92+
else:
93+
pass
94+
return websites,emails
95+
7996

8097
def main():
8198
header()
8299
stemTest()
83100
print ("Tor Ip Address :")
84-
readPage("http://www.whatsmyip.net/")
101+
a = readPage("http://www.whatsmyip.net/")
102+
print (get_all_emails(a))
85103
print ("\n\n")
86104
#readPage("http://od6j46sy5zg7aqze.onion")
87105
return 0
88106

89107
if __name__ == '__main__':
90-
main()
108+
main()

0 commit comments

Comments
 (0)