If i try to navigate to the url of the iframe it redirects me to the main web page. With my code if i try to access the webelements inside the iframe i got no results
Also i need to maximize the IE window as id does not show all details if not maximized, i do this manually.
if i try this line for getting the content of the iframe , i get "Access is denied" message:
Code:
[COLOR=#333333]Sub wanabet()[/COLOR]<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">
Set IE = New InternetExplorerMedium
Dim HTMLDoc As HTMLDocument
Dim frames As IHTMLElementCollection
Dim fCounter As Long
With IE
.navigate "https://www.wanabet.es/index.html#!/sport/?params=home"
.Visible = True
Application.Wait (Now + TimeValue("0:00:10"))
End With
Set frames = IE.document.getElementsByTagName("iframe")
For fCounter = 0 To frames.Length - 1
If Left(frames(fCounter).ID, 9) = "iframe-sb" Then
x = fCounter
Exit For
End If
Next
'this list has 0 items in it, which is wrong'
Set sporturi = frames(x).document.getElementsByClassName("KambiBC-navigation-menu__list-item")
x = sporturi.Length
For Each sport In sporturi
fotbal = sport.getElementByClassName("KambiBC-navigation-menu__label--title").innerText
if fotbal = "Futbol"
'''' do stuff'''
next sport
End Sub</code>[COLOR=#333333] fotbal = sport.getElementByClassName("KambiBC-navigation-menu__label--title").innerText[/COLOR]
Also i need to maximize the IE window as id does not show all details if not maximized, i do this manually.
if i try this line for getting the content of the iframe , i get "Access is denied" message:
Code:
Set sporturi = frames(x).contentWindow.document.getElementsByClassName("KambiBC-navigation-menu__list-item")