Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 404 error for upcoming NCAAB season #215

Closed
roclark opened this issue Oct 3, 2019 · 0 comments · Fixed by #216
Closed

HTTP 404 error for upcoming NCAAB season #215

roclark opened this issue Oct 3, 2019 · 0 comments · Fixed by #216
Assignees
Labels
bug Something isn't working
Milestone

Comments

@roclark
Copy link
Owner

roclark commented Oct 3, 2019

Describe the bug
When trying to pull data for the upcoming NCAAB season, a 404 error will be returned as the requested data is not yet available. Currently, the error has the following traceback:

Traceback (most recent call last):
  File "tests/exhaustive/test_ncaab.py", line 7, in <module>
    for team in Teams():
  File "/home/runner/work/sportsreference/sportsreference/sportsreference/ncaab/teams.py", line 999, in __init__
    self._retrieve_all_teams(year)
  File "/home/runner/work/sportsreference/sportsreference/sportsreference/ncaab/teams.py", line 1125, in _retrieve_all_teams
    doc = pq(BASIC_STATS_URL % year)
  File "/opt/hostedtoolcache/Python/3.5.7/x64/lib/python3.5/site-packages/pyquery/pyquery.py", line 223, in __init__
    html = url_opener(url, kwargs)
  File "/opt/hostedtoolcache/Python/3.5.7/x64/lib/python3.5/site-packages/pyquery/openers.py", line 78, in url_opener
    return _requests(url, kwargs)
  File "/opt/hostedtoolcache/Python/3.5.7/x64/lib/python3.5/site-packages/pyquery/openers.py", line 63, in _requests
    resp.reason, resp.headers, None)
urllib.error.HTTPError: HTTP Error 404: Not Found

To Reproduce
Pull any data for NCAAB in the new season.

from sportsreference.ncaab.teams import Teams

for team in Teams():
    print(team.name)

Expected behavior
Either the error will be handled and the code will continue without errors and no data will be retrieved, or the previous year will be queried instead.

Desktop (please complete the following information):

  • OS: Ubuntu 18.04 (affects all)
  • Sportsreference Version: 0.4.5
@roclark roclark added the bug Something isn't working label Oct 3, 2019
@roclark roclark added this to the Release 0.5.0 milestone Oct 3, 2019
@roclark roclark self-assigned this Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant