basketball_reference_web_scraper icon indicating copy to clipboard operation
basketball_reference_web_scraper copied to clipboard

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

Open germannp opened this issue 4 years ago • 3 comments

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!

germannp avatar Feb 26 '22 20:02 germannp

I'm having the same issue

sdm373373 avatar Feb 27 '22 23:02 sdm373373

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 :-)

germannp avatar Feb 28 '22 08:02 germannp

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

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

tttgm avatar Mar 07 '22 11:03 tttgm