joenano / rpscrape

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

Not Scraping Topspeed #149

Open viewform opened 1 month ago

viewform commented 1 month ago

Excellent Script Great Work !

But it doesnt appear to scrape the Topspeed Column "TS" (as detailed in the example from Ascot)

Does anyone know why?

Regards

Keith

joenano commented 1 month ago

create a copy of default_settings.toml called user_settings.toml in the settings folder and set ts to true, its false by default

https://github.com/joenano/rpscrape/tree/master/settings

viewform commented 1 month ago

Cheers, got it, I didnt have a user_settings.toml file and didnt want to touch the default file Thanks, great piece of code, very useful. Ive still not worked out how to scrape the racecard from the JSON file. Which is the easiest way? Ive got the JSON file downloaded.

Thanks Keith

viewform commented 1 month ago

OK so ive managed to get the JSON data for racecards to csv which is great, i noticed that the horses silks image url isnt an option in the "runners" section in the JSON file, what would be the easiest way to add this to the scrape?

Thanks

Keith

rmwesley99 commented 1 month ago

Same answer as above... look at: https://github.com/joenano/rpscrape/tree/master/settings

[fields.runner_info]`
    silk_url = false    # Url of owners silks image

Create a copy of default_settings.toml called user_settings.toml in the settings folder and set silk_url to true. It is false by default.

viewform commented 1 month ago

Sorry, does this apply to thr racecards that are in JSON format as well as the results?

rmwesley99 commented 1 month ago

No, the user_settings.toml file is just used to configure the data fields scraped for historical results.

viewform commented 1 month ago

I thought so, as I tried it and it didnt scrape the "silks" column,, would you know the easiest way to add this into the python file racecards.py so it will appear in the JSON file?

Thanks

rmwesley99 commented 1 month ago

Like you say... you would need to make a local copy of racecards.py and add the code to download it. If you don't know any python, you will need to learn some. There is enough code in there that you can probably just cut-and-paste-and-edit a similar field. I use the race cards to automate the process of looking for potential betting opportunities so just need the course, race, horse, jockey, and trainer data, i.e. no need for the silks information cluttering up the JSON file. I'm guessing some / most others are probably the same.