joenano / rpscrape

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

Distance to Furlong Error - Conversion to Float #83

Closed patem2 closed 2 years ago

patem2 commented 2 years ago

Hi,

I spotted an error today when processing todays racecards, could not convert string to float.

Tomorrow's racecards work fine so must be something in the distance text it doesn't like today for a specific race? :-)

Traceback (most recent call last): File "./racecards.py", line 395, in main() File "./racecards.py", line 385, in main races = parse_races(session, race_docs, date) File "./racecards.py", line 242, in parse_races race['distance_f'] = distance_to_furlongs(race['distance_round']) File "./racecards.py", line 29, in distance_to_furlongs return float(dist) ValueError: could not convert string to float: ''

joenano commented 2 years ago

This was caused by a race from the previous day showing in todays racecards and the link was redirecting to a results page with the racecard page no longer existing. Should be fixed d03b967fddb6e11ed07e46a6f2692cc98d4a54f0

patem2 commented 2 years ago

Thanks bud 😀