I want to click a href link that is dynamic.I have really very little clue as to what am i doing, as i have little knowledge of programing(still doing VBA tutorials).I am not sure if it can be done with VBA or i need JAVA(of which i know almost zero). A push in the right direction would be great.
FYI i did ask this question on stackoverflow, and chandoo, but got no answer.
Code:
[COLOR=#E56717][B]Sub[/B][/COLOR] useClassnames()
[COLOR=#151B8D][B]Dim[/B][/COLOR] row [COLOR=#151B8D][B]As[/B][/COLOR] [COLOR=#F660AB][B]Long[/B][/COLOR]
[COLOR=#151B8D][B]Dim[/B][/COLOR] link [COLOR=#151B8D][B]As[/B][/COLOR] IHTMLElementCollection
[COLOR=#151B8D][B]Dim[/B][/COLOR] ie [COLOR=#151B8D][B]As[/B][/COLOR] InternetExplorer
[COLOR=#151B8D][B]Set[/B][/COLOR] ie = [COLOR=#E56717][B]New[/B][/COLOR] InternetExplorer
[COLOR=#8D38C9][B]With[/B][/COLOR] ie
.navigate [COLOR=#800000]"https://www.unibet.ro/betting#filter/all/all/all/all/in-play"[/COLOR]
.Visible = [COLOR=#00C2FF][B]True[/B][/COLOR]
[COLOR=#8D38C9][B]Do[/B][/COLOR] [COLOR=#8D38C9][B]While[/B][/COLOR] ie.readyState <> READYSTATE_COMPLETE
[COLOR=#8D38C9][B]DoEvents[/B][/COLOR]
[COLOR=#8D38C9][B]Loop[/B][/COLOR]
[COLOR=#8D38C9][B]End[/B][/COLOR] [COLOR=#8D38C9][B]With[/B][/COLOR]
[COLOR=#8D38C9][B]Do[/B][/COLOR] [COLOR=#8D38C9][B]Until[/B][/COLOR] ie.document.getElementsByClassName([COLOR=#800000]"KambiBC-event-item__participants-container"[/COLOR]).Length > 0
[COLOR=#8D38C9][B]DoEvents[/B][/COLOR]
[COLOR=#8D38C9][B]Loop[/B][/COLOR]
row = 1
[COLOR=#8D38C9][B]If[/B][/COLOR] Cells(row, 1).Value = 0 [COLOR=#8D38C9][B]Then[/B][/COLOR]
[COLOR=#151B8D][B]Set[/B][/COLOR] link = ie.document.getElementsByTagName([COLOR=#800000]"a"[/COLOR])
[COLOR=#8D38C9][B]For[/B][/COLOR] [COLOR=#8D38C9][B]Each[/B][/COLOR] l [COLOR=#8D38C9][B]In[/B][/COLOR] link
[COLOR=#8D38C9][B]If[/B][/COLOR] link.className = [COLOR=#800000]"KambiBC-event-item__link KambiBC-js-event-item-link"[/COLOR] [COLOR=#8D38C9][B]Then[/B][/COLOR]
link.Click
[COLOR=#E56717][B]Exit[/B][/COLOR] [COLOR=#8D38C9][B]For[/B][/COLOR]
[COLOR=#8D38C9][B]End[/B][/COLOR] [COLOR=#8D38C9][B]If[/B][/COLOR]
[COLOR=#8D38C9][B]Next[/B][/COLOR]
row = row + 1
[COLOR=#8D38C9][B]End[/B][/COLOR] [COLOR=#8D38C9][B]If[/B][/COLOR]
[COLOR=#8D38C9][B]End[/B][/COLOR] [COLOR=#E56717][B]Sub[/B][/COLOR]
FYI i did ask this question on stackoverflow, and chandoo, but got no answer.