SQUIDD
Well-known Member
- Joined
- Jan 2, 2009
- Messages
- 2,107
- Office Version
- 2019
- 2016
- Platform
- Windows
Hello All
Thanks for looking.
Please see the example of webpage i am trying to extract data from.
www.timeform.com
My code to load the page below.
I have tried several methods, get by class name then by tagname, a mixture of them all, but i just do not understand the structure of this table.
thanks for looking, any help huge thanks, happy to move to xmlhttp if easier/better, although my understanding of this is 0.
But with an example im sure i can finish my project.
thanks
dave
Thanks for looking.
Please see the example of webpage i am trying to extract data from.
![www.timeform.com](/board/proxy.php?image=https%3A%2F%2Fwww.timeform.com%2Fhorse-racing%2Fcontent%2Fimg%2Ftimeformplaysmarterlogo.png&hash=1d3f9511c804abf5661c91e06103bd57&return_error=1)
STANDBY ASHLEY Greyhound Form, Results & Ratings | Timeform
Get form, results and ratings for the Greyhound STANDBY ASHLEY, trained by S L Newberry and owned by Mr S A Ashley,mr M D Gould,mrs S L Newberry.
My code to load the page below.
VBA Code:
Sub get_dogs_a()
Dim Doc As HTMLDocument
Dim ie As InternetExplorer
Set ie = New InternetExplorer
ie.Navigate "https://www.timeform.com/greyhound-racing/greyhound-form/standby-ashley/66258"
Do While ie.ReadyState = 4: DoEvents: Loop
Do Until ie.ReadyState = 4: DoEvents: Loop
Do While Doc Is Nothing: Set Doc = ie.Document: DoEvents: Loop
DOGNAME = Trim(Replace(Doc.getElementsByClassName("w-dog-ledger-header w-content")(0).getElementsByTagName("h1")(0).innerText, "Greyhound Profile", ""))
Do While DOGNAME = DOGNAMEOLD: DOGNAME = Doc.getElementById("dogHeaderTitle").innerText: Loop
Worksheets("pos " & C - 3).Cells.ClearContents
Worksheets("app").Cells(C, 11) = DOGNAME: Worksheets("pos " & C - 3).Cells(1, 1) = DOGNAME
COUNTER = 0
resultcount = Doc.getElementsByClassName("recent-form-meeting-date").Length
'its at this point i would like to get info out of the table.How would i handle getting for instance the 4th column info header as GDE. in this example row 1 is A2 as is row 2.
'as an example if we could simple output all the GDE into column A. I cannot seem to work out how.
End Sub
I have tried several methods, get by class name then by tagname, a mixture of them all, but i just do not understand the structure of this table.
thanks for looking, any help huge thanks, happy to move to xmlhttp if easier/better, although my understanding of this is 0.
But with an example im sure i can finish my project.
thanks
dave