Skip to content

Commit 3f875d9

Browse files
authored
Add files via upload
1 parent 7d3dcd1 commit 3f875d9

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import requests
2-
import re
2+
from bs4 import BeautifulSoup
3+
34

45
# get url
56
url = input('Enter a URL (include `http://`): ')
67

78
# connect to the url
8-
website = requests.get(url)
9-
10-
# read html
11-
html = website.text
12-
13-
# use re.findall to grab all the links
14-
links = re.findall('"((http|ftp)s?://.*?)"', html)
15-
emails = re.findall('([\w\.,]+@[\w\.,]+\.\w+)', html)
16-
9+
responce = requests.get(url)
10+
html = responce.text
11+
soup = BeautifulSoup(html,"html.parser")
12+
print(html)
1713

18-
# print the number of links in the list
19-
print("\nFound {} links".format(len(links)))
20-
for email in emails:
21-
print(email)
14+
links = []
15+
for i in soup.find_all("a",href=True):
16+
links.append(i)
17+
print("leitud link: ", i)
18+
# # print the number of links in the list
19+
# print("\nFound {} links".format(len(links)))
20+
# for email in emails:
21+
# print(email)

0 commit comments

Comments
 (0)