Skip to content

Commit 866d464

Browse files
committed
update .py
1 parent 59af73c commit 866d464

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

automaticwebsiteurlscraper.py/webUrlscraper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
page=Request(Url, headers={'User-Agent':'Mozilla/5.0'})
1717
page=urlopen(page, context=ctx, ).read()
1818
# Using beautifulsoup to read the contents of the page
19-
soup = BeautifulSoup(page, 'html.parser')
19+
soup=BeautifulSoup(page, 'html.parser')
2020
# finding all the link headers
21-
links = soup.findAll('a')
21+
links=soup.findAll('a')
2222
if(links is not None) :
23-
finalLinks = []
23+
finalLinks=[]
2424
# getting actual site links from the header a
2525
for link in links :
2626
if 'href' in str(link):
2727
templist = str(link).split("href")
2828
index1 = templist[-1].index("\"")
2929
index2 = templist[-1][index1 + 1 : ].index( "\"" )
30-
finalLinks.append(templist[-1][ index1 : index2 + 3 ])
30+
finalLinks.append(templist[-1][index1 : index2 + 3])
3131
print("Here are your final links")
3232
# printing the final completed list
3333
for i in finalLinks:

0 commit comments

Comments
 (0)