Last active
December 29, 2020 23:08
-
-
Save gabecano4308/62f76baff4221c06159313b0c9c115f8 to your computer and use it in GitHub Desktop.
for part two
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
| 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