Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- def ExtractLinks(url):
- links = []
- website = requests.get(url)
- website_text = website.text
- soup = BeautifulSoup (website_text, "html.parser")
- for link in soup.find_all("a") :
- links.append(link.get("href"))
- for link in links:
- print (link)
- print(len(links))
- ExtractLinks("https://bplant.org/")
- ExtractLinks("https://www.vidlii.com/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement