Summary:
This program takes two current NBA players and compares them based on stats the user chooses from a list. The program uses the requests and beautifulsoup modules from python to parse data from the Basketball Reference website. The data is then sifted and only the select statstics are taken and displayed. The program then shows the user which player is leading each stat.
Limitations:
-cannot parse data for players that are retired
-cannot parse data if user spells the name of the player wrong in any way, the name must be spelled perfectly
-cannot finish gathering statsics if the user enters which statistics they want incorrectly
Below is a sample of the running program:
Step 1 : We are prompted to list the names of two current NBA players by entering the first then the last name for each.
Step 2: We are then prompted to choose the list of stats we want to compare and enter them as a space separated list spelled the way they are given in any order we want.
Step 3: We will list all of the stats so we can compare the two players, Kevin Durant and LeBron James, based on all of the stats available to the program.
Step 4: Now the program will compare the two players and list their stats as well as an arrow pointing to who is leading in that particular stat. The results are then shown in a table format.
We can see here that Durant leads in 6 stat categories whereas James leads in 4 of the stat categories.