I use
Dim IE As InternetExplorerMedium
Set IE = New InternetExplorerMedium
For Each ele In IE.Document.getElementsByTagName("a")
Debug.Print ele.innerhtml
If InStr(ele.innerhtml, "Resolver") > 0 Then Debug.Print "OK": Exit For
next
For Each ele In IE.Document.getElementsByClassName("textoblanco")
Debug.Print ele.innerhtml
If InStr(ele.innerhtml, "Resolver") > 0 Then Debug.Print "OK": Exit For
next
the wweb page is:
<a href="javascript:botonDuplicarActividad();" class="textoblanco">Duplicar </a>
<a href="javascript:botonHojaTecnica();" class="textoblanco">Hoja Tec </a>
<a href="javascript:botonResolver();" class="textoblanco">Resolver </a>
The first "For each" work and execute Debug.Print "OK" but the second "For Each" not work: Run time :438. object doesn't support this property or methode
i try use a web page from excel
There's no problem with
getElementsByClassNamein IE unless you have a really old version.This works fine for me: