I was trying to extract results from similar table:
I have applied following code but doesn't seem to work. Any ideas on what table elements should be used?:
Sub Macro1()
Dim IE As New InternetExplorer
Dim CompetitionLink As String
CompetitionLink = ThisWorkbook.Worksheets("Settings").Range("B2")
IE.Navigate CompetitionLink
IE.Visible = True
Rank = IE.Document.getElementsByTagName("grid sc")(0).Rows(1).Cells(2).innerText
Debug.Print Rank
End Sub
Try that code
Sub Test()
Dim ie As New InternetExplorer
Dim competitionLink As String
Dim rank As String
competitionLink = ThisWorkbook.Worksheets("Settings").Range("B2")
With ie
.Visible = True
.navigate competitionLink
Do: DoEvents: Loop Until .readyState = 4
rank = .document.getElementsByClassName("grid sc")(0).Rows(1).Cells(2).innerText
Debug.Print rank
End With
End Sub
** You can also grab all the table data .. Have a look at this link Scrape HTML Table