So I'm wondering what I should replace "ele.innerText" with so that the pace figures will be displayed
Heres a gif of the element area im trying to download (for each horse, theres 11 horses in this race) , the pace figures are all listed in the "card-entry" classnames https://gfycat.com/SameLastingHadrosaurus
and heres a link to the page itself https://www.attheraces.com/racecard/Huntingdon/22-December-2020/1535/pacechart
Code: Select all
URL := "https://attheraces.com/racecard/Huntingdon/22-December-2020/1535/pacechart"
tooltip Downloading page
page:=download(URL) ; Download page to memory
tooltip
document := ComObjCreate("HTMLFile") ; Create an HTML file in memory
document.write(page)
elements:=document.getElementsByClassName("card-entry") ; Get elements with class "card-entry"
loop {
try ele:=elements[A_Index-1] ; loop through each element
catch ; Above line gives error when we run out of elements
break ; Then we break out of loop
msgbox % ele.innerText ; Display its innerText for example
}
return
;Ref: https://www.autohotkey.com/docs/commands/URLDownloadToFile.htm#WHR
Download(url){
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", url, true)
whr.Send()
whr.WaitForResponse()
return whr.ResponseText
}