Created
April 22, 2020 20:36
-
-
Save openroomxyz/2857cb2a9fb97c9c45793abaf6b940a1 to your computer and use it in GitHub Desktop.
Python : How can i get get all url -s on page ? (html only)
This file contains hidden or 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 bs4 as bs | |
import urllib.request | |
sauce = urllib.request.urlopen('https://singularityhub.com/').read() | |
soup = bs.BeautifulSoup(sauce, 'lxml') | |
for url in soup.find_all('a'): | |
#print(url) | |
print(url.text) | |
print(url.get('href')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment