joenano / rpscrape

Scrape horse racing results data and racecards.
140 stars 57 forks source link

Error pulling down today's racecards #126

Closed WaspStar closed 1 year ago

WaspStar commented 1 year ago

This has just started today. When I try to pull down today's racecards using the command, "racecards.py today", I'm getting the following errors (note: racecards.py tomorrow is working fine at the moment)

Traceback (most recent call last): File "C:\rpscrape\scripts\racecards.py", line 459, in main() File "C:\rpscrape\scripts\racecards.py", line 449, in main races = parse_races(session, race_urls, date) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\rpscrape\scripts\racecards.py", line 296, in parse_races race['distance_f'] = distance_to_furlongs(race['distance_round']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\rpscrape\scripts\racecards.py", line 39, in distance_to_furlongs return float(dist) ^^^^^^^^^^^ ValueError: could not convert string to float: ''

Thanks!

rmwesley99 commented 1 year ago

It is normally just a transient issue with incorrectly formatted HTML on the RP website (he says trying to sound like he knows what he is talking about). Today's race card attached from when it was working yesterday. Just rename from a TXT to a JSON file. 2022-11-01.txt

joenano commented 1 year ago

Its the flemington races, having a look just now.

Links seem to be forwarding to the result page instead of the racecard.

WaspStar commented 1 year ago

Thank you @rmwesley99 @joenano

joenano commented 1 year ago

Should be fixed in latest.

WaspStar commented 1 year ago

Thank you @joenano - works perfectly after an upgrade.

Just for info, when I do an upgrade, it definitely works, but I get the message, "Failed to update" afterwards.

joenano commented 1 year ago

Just for info, when I do an upgrade, it definitely works, but I get the message, "Failed to update" afterwards.

this is very annoying to test, seems to work for some and not for others, you can turn off auto update in settings and git pull manually