Created
December 16, 2018 04:13
-
-
Save saiyerniakhil/7f557d740d27d855c8305b4abb7c24c8 to your computer and use it in GitHub Desktop.
Sample code for getting all links in a webpage
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 | |
linkset = [] | |
page = requests.get('www.wikipedia.org') # The URL is of your choice | |
soup = BeautifulSoup(page.content, 'html.parser') | |
linkset = soup.find_all('a') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment