• Hi Guest Just in case you were not aware I wanted to highlight that you can now get a free 7 day trial of Horseracebase here.
    We have a lot of members who are existing users of Horseracebase so help is always available if needed, as well as dedicated section of the fourm here.
    Best Wishes
    AR

Scrape racingpost cards with python please help

Here's today racecards - as csvs - for 14/08/2021
 

Attachments

  • 2021-08-14 racecards - fixtures.csv
    13 KB · Views: 19
  • 2021-08-13 racecards - runners.csv
    354.1 KB · Views: 14
15/08/2021
 

Attachments

  • 2021-08-15 racecards - fixtures.csv
    6.8 KB · Views: 6
  • 2021-08-15 racecards - runners.csv
    332.5 KB · Views: 8
Rename this file, "rprc_json2csv.py"

Then edit line 5, and enter the location of your json racecards.

For example, when 2021-08-15.json is in the target folder:

python rprc_json2csv.py

will create, 2021-08-15 racecards - runners.csv which looks like:

1629038652720.png
 

Attachments

  • rprc_json2csv_py.txt
    2.1 KB · Views: 31
FHRTIPS FHRTIPS

I have just tried the program and the only problem I had was the weight and sp are all over the place but that can be sorted

is this what you need
 

Attachments

  • yesterday.xlsx
    88.4 KB · Views: 14
FHRTIPS FHRTIPS

I have just tried the program and the only problem I had was the weight and sp are all over the place but that can be sorted

is this what you need
Hi Stuart, yeah something like that I have attach what info I need
James
 

Attachments

  • photo_2021-08-15_18-09-23.jpg
    photo_2021-08-15_18-09-23.jpg
    72.8 KB · Views: 27
Hi Stuart, yeah something like that I have attach what info I need
James
I downloaded the full year 2021 up until yesterday but it was too large to upload so I cut the most recent part out but left all the headings behind,you can download tomorrows card,I am using windows 10 have python 3.9 and just followed his instructions to install to a tee no problem
have a go
good luck
 
FHRTIPS FHRTIPS
Save you doing your head in I dont think this is the software you are looking for there used to be a rp scraper on here but as far as I know it has been removed this is what you get from this program
 

Attachments

  • James.xlsx
    12.6 KB · Views: 25
FHRTIPS FHRTIPS
Save you doing your head in I dont think this is the software you are looking for there used to be a rp scraper on here but as far as I know it has been removed this is what you get from this program
Hi sorry for late reply had been to a funeral all day,
sheet seems good, here is what i need
Course Draw Race Distance Cloth Number Horse DSLR Form

James
 
If you can complete up to and including Section 5 of "The Complete Android Oreo Developer Course - Build 23 Apps!" course available from Building Android Apps: The Complete Android Oreo Course (currently £15.99) you should be able to create an Android app to scrape data from Racing Post cards, however you will use Java not Python.
To be honest if what you want to do is get the data, then don't create a big, ambitious app.
Do what the other experienced people have suggested; lots of simple, single function bits of software. Build up your knowledge bit by bit. Use the little bits of code here and learn what they do.

Creating an app for Android is really complicated. Possibly not as complicated as for iPhone.

If you're struggling with Python then all the Android settings will be a nightmare. I've just used Thorium, which is a low-code app builder. You can create apps that will run on phones as well as desktops. I'm not affiliated to this whatsoever, just an experienced programmer (since 1968) - Thorium Builder - Progressive Web Apps (PWA) Builder

Sort your process (or algorithm) out by hand and do it all manually at first.
 
Yes, I went off topic bringing Android and Java into it. Bringing it back to Python I found a good YouTube video called 'Python Tutorial: Web Scraping with Requests-HTML' by Corey Schafer
. The video teaches how to write a Python program (script) to scrape information from a website and save it into a Comma Separated Value (CSV) file for subsequent use in Microsoft Excel. Using Requests-HTML and Chromium (to render) a script can be written to scrape data from Racing Post online racecards including the odds which is dynamic data generated by JavaScript.
 
Freely available information from the Racing Post was scraped and used to rate horses according to Clive Holt’s Fineform Master Formula and put on a website patrickb.eu.pythonanywhere.com/racing
(The formula is not exactly the same as Mr. Holt's because there is an adjustment for the number of runners.)
 
Last edited:
Back
Top