nesticot commited on
Commit
073a4a7
·
1 Parent(s): bd36e6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -25
app.py CHANGED
@@ -105,30 +105,30 @@ for x in data_r['fantasy_content']['league']['players']:
105
  yahoo_df = pd.DataFrame(total_list,columns = ['player_id','rank_value','full','first','last','average_pick','average_auction_cost','display_position','editorial_team_abbr','percent_owned'])
106
  yahoo_df_2 = yahoo_df.copy()
107
 
108
- # Write your code here.
109
- response = requests.get("https://www.naturalstattrick.com/playerlist.php?fromseason=20232024&thruseason=20232024&stype=2&sit=all&stdoi=oi&rate=n")
110
- soup = BeautifulSoup(response.text, 'html.parser')
111
- table_rows = soup.findAll('tr')
112
- table_rows = table_rows[1:-1]
113
- table_rows[0].findAll('td')
114
-
115
- player_name = []
116
- player_position = []
117
- player_team = []
118
- player_id = []
119
-
120
- for i in range(0,len(table_rows)-1):
121
- player_name.append(str(table_rows[i].findAll('td')[0].contents[0]))
122
- player_position.append(table_rows[i].findAll('td')[1].contents[0])
123
- player_team.append(table_rows[i].findAll('td')[2].contents[0])
124
- player_id.append(str(table_rows[i].findAll('td')[3].contents[0])[-76:][:7])
125
-
126
- player_id_df = pd.DataFrame({'Player':player_name,'Player ID':player_id,'Position':player_position,'Team':player_team})
127
- #player_id_df.index.name = 'Player Name'
128
- player_id_df.head()
129
-
130
- skater_df = player_id_df[player_id_df['Position'] != 'G']
131
- goalie_df = player_id_df[player_id_df['Position'] == 'G']
132
 
133
  season = 20232024
134
  seasontype = 2
@@ -420,4 +420,5 @@ def server(input, output, session):
420
 
421
 
422
 
423
- app = App(app_ui, server)
 
 
105
  yahoo_df = pd.DataFrame(total_list,columns = ['player_id','rank_value','full','first','last','average_pick','average_auction_cost','display_position','editorial_team_abbr','percent_owned'])
106
  yahoo_df_2 = yahoo_df.copy()
107
 
108
+ # # Write your code here.
109
+ # response = requests.get("https://www.naturalstattrick.com/playerlist.php?fromseason=20232024&thruseason=20232024&stype=2&sit=all&stdoi=oi&rate=n")
110
+ # soup = BeautifulSoup(response.text, 'html.parser')
111
+ # table_rows = soup.findAll('tr')
112
+ # table_rows = table_rows[1:-1]
113
+ # table_rows[0].findAll('td')
114
+
115
+ # player_name = []
116
+ # player_position = []
117
+ # player_team = []
118
+ # player_id = []
119
+
120
+ # for i in range(0,len(table_rows)-1):
121
+ # player_name.append(str(table_rows[i].findAll('td')[0].contents[0]))
122
+ # player_position.append(table_rows[i].findAll('td')[1].contents[0])
123
+ # player_team.append(table_rows[i].findAll('td')[2].contents[0])
124
+ # player_id.append(str(table_rows[i].findAll('td')[3].contents[0])[-76:][:7])
125
+
126
+ # player_id_df = pd.DataFrame({'Player':player_name,'Player ID':player_id,'Position':player_position,'Team':player_team})
127
+ # #player_id_df.index.name = 'Player Name'
128
+ # player_id_df.head()
129
+
130
+ # skater_df = player_id_df[player_id_df['Position'] != 'G']
131
+ # goalie_df = player_id_df[player_id_df['Position'] == 'G']
132
 
133
  season = 20232024
134
  seasontype = 2
 
420
 
421
 
422
 
423
+ app = App(app_ui, server)
424
+ time.sleep(60)