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

client.play_by_play failing with ValueError: time data 'Time' does not match format '%M:%S.%f' #229

Open
germannp opened this issue Feb 26, 2022 · 3 comments

Comments

@germannp
Copy link

germannp commented Feb 26, 2022

Hello,

I am running into this ValueError: time data 'Time' does not match format '%M:%S.%f' error with client.play_by_play:

Traceback (most recent call last):
...
    client.play_by_play(
  File "...\basketball_reference_web_scraper\client.py", line 220, in play_by_play
    values = http_service.play_by_play(home_team=home_team, day=day, month=month, year=year)
  File "...\basketball_reference_web_scraper\http_service.py", line 104, in play_by_play
    return self.parser.parse_play_by_plays(
  File "...\basketball_reference_web_scraper\parser_service.py", line 92, in parse_play_by_plays
    return self.play_by_plays_parser.parse(
  File "...\basketball_reference_web_scraper\parsers.py", line 541, in parse
    result.append(self.format_data(
  File "...\basketball_reference_web_scraper\parsers.py", line 553, in format_data
    "remaining_seconds_in_period": self.period_timestamp_parser.to_seconds(timestamp=play_by_play.timestamp),
  File "...\basketball_reference_web_scraper\parsers.py", line 157, in to_seconds
    dt = datetime.strptime(timestamp, self.timestamp_format)
  File "C:\ProgramData\Anaconda3\lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "C:\ProgramData\Anaconda3\lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data 'Time' does not match format '%M:%S.%f'

Any ideas?

I assume this started around February 17th, however it won't work with previous dates neither.

Thank you!

@sdm373373
Copy link

I'm having the same issue

@germannp
Copy link
Author

To me it look like this package is no longer maintained: they don't even bother fixing links to the wrong package in the docs (see #227). On the bright side, this "wrong" package works, looks very much alive, and also scraps shot charts; so I guess it's time to move on to https://github.com/vishaalagartha/basketball_reference_scraper/blob/master/API.md :-)

@tttgm
Copy link

tttgm commented Mar 7, 2022

I've submitted a pull request for this issue here: PR-230

Not sure if the repo is still maintained though as you said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants