joenano / rpscrape

Scrape horse racing results data and racecards.
146 stars 60 forks source link

TypeError: Dict key must be str #122

Closed patem2 closed 2 years ago

patem2 commented 2 years ago

Hi,

When trying to run the rpscrape module I've noted the following error both today and on Thursday so seems to be intermittent (as it worked yesterday):

Traceback (most recent call last): File "racecards.py", line 443, in main() File "racecards.py", line 439, in main f.write(dumps(races).decode('utf-8')) TypeError: Dict key must be str

Best wishes mp

patem2 commented 2 years ago

if it helps, I think it's the US racing which seems to be the issue, the country string is None as opposed to "US":

image

patem2 commented 2 years ago

Fixed the error:

If you place in the courses folder and file _courses the following course ID entry it should work (under the "usa" section)

"1699": "Belmont At The Big A",

Been learning a bit of python of late and some of it is starting to make sense lol

rmwesley99 commented 2 years ago

Nice work mate. The python is definitely coming along 😁

joenano commented 2 years ago

The Belmont races are being run at Aqueduct temporarily while renovations are on going at Belmont. Strange to make a pointless temporary course name imo, should be advertised and recorded as Aqueduct.

joenano commented 2 years ago

Fixed aa5c5ac096446809267ad44a18e12c05027b53dc