View Single Post
  #21  
Old 4th August 2015, 12:56 AM
walkermac walkermac is offline
Member
 
Join Date: Nov 2013
Posts: 605
Default

Quote:
Originally Posted by evajb001
Does/Has anyone used the sectional time and average speed data supplied as part of the form by one of the main aus horse racing websites. Their web address starts with P and rhymes with hunters?
...snip...
So i'm interested if anyone uses it as part of their process and/or does anyone scrape this info into excel via web queries?

I don't think you can use an Excel Web Query, given how the page is constructed.

I discovered phantomJS recently (http://phantomjs.org), a headless browser which lets you get at the "guts" of a page that a server creates with javascript (and where the content remains otherwise hidden if you were to view the HTML source directly). You can call it from Excel using VBA:
Code:
Dim wsh As Object Set wsh = VBA.CreateObject("WScript.Shell") Dim waitOnReturn As Boolean: waitOnReturn = True Dim windowStyle As Integer: windowStyle = 1 wsh.Run "C:\phantomjs.exe C:\test.js", windowStyle, waitOnReturn

In your test.js file you'd have a script that simply opened the URL you wanted, then output it to a text file. Once it was there you could open that text file in VBA and parse it however you like.

The average speed data comes out looking like:
Code:
div class="template-wrapper" data-barrier-number="8" data-runner-number="2" data-avg-early="59.2" data-avg-mid="61.4" data-avg-late="61.3" data-avg-speed="60.78">

To get distance-specific sectional speeds is a bit more painful. You can either just cherry pick from each runner's last 10 races which are loaded by default; else you'll have to read up a bit more on PhantomJS and learn how to do some Page Automation (selecting the correct item from a dropdown, click a button and then saving the output for parsing).


Mid and Late speeds I imagine would depend quite a bit on the particular race circumstance and track layout - to the point where I would question its usefulness (you can select a horse's races at the same distance at the same track, but most races would undoubtedly not have enough info to draw sound conclusions from). Maybe, if you built up enough data you could find blackbook runners by noting unusually fast late speeds given fast early speeds.

I can see how the Early Speed indicator would be handy in predicting the pace of a race. And in recording the data over a number of years you could determine track/distance combos where Early Speed was particularly advantageous (likely ones with tight/early bends and/or short straights).


I know you raised this on the Communal Ratings thread and called for interest, but I don't really know much about how to apply it. I've used settling positions to predict leaders and pace in the past, and it was accurate often enough to make the exercise feel worthwhile - but probably was not at all helpful, just as often.
Reply With Quote