Created
July 3, 2019 12:26
-
-
Save shubham-singh-ss/e4a1b0cd6b898e125910cdb5f29e4348 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python3 | |
# Anchor extraction from html document | |
from bs4 import BeautifulSoup | |
from urllib.request import urlopen | |
with urlopen('LINK') as response: | |
soup = BeautifulSoup(response, 'html.parser') | |
for anchor in soup.find_all('a'): | |
print(anchor.get('href', '/')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment