Skip to content

Instantly share code, notes, and snippets.

@gabecano4308
Last active December 29, 2020 23:08
Show Gist options
  • Select an option

  • Save gabecano4308/62f76baff4221c06159313b0c9c115f8 to your computer and use it in GitHub Desktop.

Select an option

Save gabecano4308/62f76baff4221c06159313b0c9c115f8 to your computer and use it in GitHub Desktop.
for part two
base_url = 'https://www.basketball-reference.com/'
# The requests library can send a GET request to the base_url
res_base = requests.get(base_url)
# BeautifulSoup library parses the content of an HTML document, in this case res_base
base_soup = BeautifulSoup(res_base.content, 'lxml')
# BeautifulSoup's .find() method searches for a tag and specified attributes, returning the first match
select_team = base_soup.find(name = 'div', attrs = {'id' : 'teams'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment