Hello, i am trying to click on a link that changes it's href value but it's classname it is always the same. What i do know about the link that i will click it is it's position, eg: the first link presented, or the third or another.
The code that i have now gives me a run time 438 on this line
.As if there is no link with this class?
The code that i have now gives me a run time 438 on this line
Code:
If link.className = "KambiBC-event-item__link KambiBC-js-event-item-link" Then
Code:
Sub useClassnames()
Dim row As Long
Dim link As IHTMLElementCollection
Dim ie As InternetExplorer
Set ie = New InternetExplorer
With ie
.navigate "https://www.unibet.ro/betting#filter/all/all/all/all/in-play"
.Visible = True
Do While ie.readyState <> READYSTATE_COMPLETE
DoEvents
Loop
End With
Do Until ie.document.getElementsByClassName("KambiBC-event-item__participants-container").Length > 0
DoEvents
Loop
row = 1
If Cells(row, 1).Value = 0 And Cells(row, 2).Value = 0 And Cells(row, 3) > 38 Then
Set link = ie.document.getElementsByTagName("a")
For Each l In link
If link.className = "KambiBC-event-item__link KambiBC-js-event-item-link" Then
link.Click
Exit For
End If
Next
row = row + 1
End If
End Sub