Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib.request
- from bs4 import BeautifulSoup
- def get_urls(url, proxy=None):
- i = 1
- with urllib.request.urlopen(linkToRes) as response:
- html = response.read()
- soup = BeautifulSoup(html, 'html.parser')
- for link in soup.find_all('a'):
- print(str(i)+".", 'Link:', link.get('href'), 'Tags:', link.text)
- linkToRes = "https://de.wikipedia.org/wiki/Links"
- get_urls(linkToRes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement