Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- import requests
- url = "https://ru.wikipedia.org/wiki/Python"
- html = requests.get(url)
- soup = BeautifulSoup(html.text, 'html.parser')
- res = {}
- for a in soup.findAll("a"):
- if res.get(a.get("href")):
- res[a.get("href")] += 1
- else:
- res[a.get("href")] = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement