Commit ea73c83 1 parent 74a51ac commit ea73c83 Copy full SHA for ea73c83
File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- VERSION = "1.2.8 "
1
+ VERSION = "1.2.9 "
Original file line number Diff line number Diff line change @@ -190,13 +190,13 @@ def current_week():
190
190
191
191
# Parse current week from a public league
192
192
s = create_session ()
193
- url = "https://football.fantasysports.yahoo.com/f1/{}" .format (PUBLIC_LEAGUE )
193
+ url = "https://football.fantasysports.yahoo.com/f1/{}/1 " .format (PUBLIC_LEAGUE )
194
194
s .headers ["User-Agent" ] = generate_user_agent ()
195
195
r = s .get (url )
196
196
soup = bs (r .text , "lxml" )
197
- matchups = soup . select_one ( "#matchupweek .matchups-body" )
198
- weeks = re .findall ( r"Week (\d+)" , matchups .text )
199
- week = weeks [ 0 ]
197
+ REGEX_PATTERN = r"Week (\d+)"
198
+ m = re .search ( REGEX_PATTERN , soup .text )
199
+ week = m . group ( 1 )
200
200
week = int (week )
201
201
202
202
return week
You can’t perform that action at this time.
0 commit comments