Skip to content

Instantly share code, notes, and snippets.

@saiyerniakhil
Created December 16, 2018 04:13
Show Gist options
  • Save saiyerniakhil/7f557d740d27d855c8305b4abb7c24c8 to your computer and use it in GitHub Desktop.
Save saiyerniakhil/7f557d740d27d855c8305b4abb7c24c8 to your computer and use it in GitHub Desktop.
Sample code for getting all links in a webpage
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