Created
November 25, 2018 15:26
-
-
Save spidezad/c646b94a1b3fd6001198e44cd0e5bece to your computer and use it in GitHub Desktop.
Get all html links with Requests and BeautifulSoup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
website = 'https://www.somewebsite.com' | |
r= requests.get(website) | |
soup = BeautifulSoup(r.text) | |
for a in soup.find_all('a', href=True): | |
print(a['href']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment