We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 780cad2 commit 6613b13Copy full SHA for 6613b13
1 file changed
08_basic_email_web_crawler.py
@@ -1,26 +1,21 @@
1
import requests
2
import re
3
4
-#get url
5
-#url=input('Enter a URL (include 'http://'):')--this is wrong
+# get url
6
url = input('Enter a URL (include `http://`): ')
7
+# connect to the url
8
+website = requests.get(url)
9
-#connect to the url
10
-website=requests.get(url)
+# read html
11
+html = website.text
12
-#read html
13
-html=website.text
14
-
15
16
-#use re.findall to grab all the links
+# use re.findall to grab all the links
17
links = re.findall('"((http|ftp)s?://.*?)"', html)
+emails = re.findall('([\w\.,]+@[\w\.,]+\.\w+)', html)
18
19
-emails=re.findall('([\w\.,]+@[\w\.,]+\.\w+)',html)
20
21
22
-#prints the number of links in the list
+# print the number of links in the list
23
print("\nFound {} links".format(len(links)))
24
25
for email in emails:
26
- print(email)
+ print(email)
0 commit comments