1

Total noob here! I'm attempting to scrape live timing from the websites used by kart tracks to display race results. At this point, I'd like to grab the data in the table every 10 to 15 seconds and dump it to an CSV file that I will eventually analyze in Excel.

I've been able to grab PDFs of the page using FakeApp for Mac, but extracting the data I want from the PDFs is challenging. I've poked around using AppleScript, but I don't know how to access the data I want from the page.

My questions:

  1. What JavaScript commands should I investigate using to capture the data?

  2. Is JS the best tool to complete this task? If not, what other tool would be easier?

  3. What terms should I use to search this site for help on this task?

Samples of the sites I'm trying to scrape:

Here is what I have tried thus far with no results.

tell application "Safari"
    activate
    open location "http://vlcharlotte.clubspeedtiming.com/sp_center/livescore.aspx"
    delay 3
    tell current tab of window 1
        do JavaScript "dr1 = document.selectNodes('//div[3]/table/tbody/tr[1]/td[3]').value;"
        --  do JavaScript "dr2 = document.selectNodes('//div[3]/table/tbody/tr[2]/td');"
        --  do JavaScript "dr3 = document.selectNodes('//div[3]/table/tbody/tr[3]/td');"
        do JavaScript "alert(dr1);"
    end tell

end tell
Marko Gresak
  • 7,950
  • 5
  • 40
  • 46
  • The page displays results in table so it shouldn't be that hard to parse out the results. What you need to do is get the page and parse it's html. Take a look at [Parsing HTML source code using applescript](http://stackoverflow.com/questions/10227097/parsing-html-source-code-using-applescript) question for further reference. I don't know anything about applescript, but I believe there are better tools to parse html, take a look at [this question](http://stackoverflow.com/a/7373003/1276128). – Marko Gresak May 25 '14 at 23:22

0 Answers0