Issue
What is wrong in my code ? I would like to add all urls from website to the array
import requests
from bs4 import BeautifulSoup
url = 'https://globalthiel.pl'
reqs = requests.get(url)
soup = BeautifulSoup(reqs.text, 'html.parser')
urls = []
for link in soup.find_all('a'):
url.append(link.get('href').text)
for i in urls:
print(i, end="")
Solution
You have a typo in your code. Replace
url.append(link.get('href').text)
with
urls.append(link.get('href').text)
Answered By - DarkMath
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.