Рет қаралды 40,958
This is part 1 of a 3-part series where we predict which NBA player will win MVP.
In this part, we'll download the NBA data we need by using web scraping. To do the scraping, we'll use python, with the selenium, beautifulsoup, pandas, and requests libraries. We'll download the files using requests and selenium, then parse them with beautifulsoup and load them into pandas DataFrames.
By the end, we'll have csv files that we can then merge and use to make predictions in parts 2 and 3 of this series.
The code that we write in this video can be found here - github.com/dataquestio/projec... .
Chapters:
00:00 Introduction
01:10 - A look at the pages we'll scrape
04:22 - Downloading MVP votes with requests
09:26 - Parsing the votes table with beautifulsoup
17:00 - Combining MVP votes with pandas
19:25 - Downloading player stats
22:41 - Using selenium to scrape a Javascript page
28:44 - Parsing the stats with beautifulsoup
32:11 - Combining player stats with pandas
33:38 - Downloading team data
37:29 - Parsing the team data with beautifulsoup
40:44 - Combining team stats with pandas
42:33 - Next steps with this project
Disclaimer: The website we'll be scraping from, Basketball Reference, allows web scraping as long as the scraping doesn't harm site performance. Not all websites allow scraping, so make sure to check the site terms before doing any scraping.
---------------------------------
Join 1M+ Dataquest learners today!
Master data skills and change your life.
Sign up for free: bit.ly/3O8MDef
#PythonTutorial #WebScraping #Python #Dataquest#Importing #Data