Click on a span element that is inside an iframe with vba

1

The page shows a text that says MAINTENANCE; by clicking with the mouse enables some text boxes, the problem is that there is no id or name to access the element by id or name.
according to me with my visual code I try to find the word maintenance to be able to click, I can not access that element.
from what I see, the loop stops when it finds the iframe and therefore does not find the elements that are inside the iframe.
Annex a bit of the code of the page.

<frame name= "hexdesktop" src="ke00.jsp" frameborder="1">
<html>
<head></head>
body>
<iframe src="ke010.jsp" frameborder="1">
<html>
</html>
<body>
<div class = "dhtmlxlayoutobject">
<table>
tbody>
<tr>
<td class = "standartTreeRow" parentobject = "[object-object]" 
style="Cursor:hand">
<span class = "standartTreeRow">MANTENIMIENTOS </span>
</td>
<tr>
</tbody>
</table>
</div>
</body>
</iframe>
</body>
</html>
</frame>

My visual code is

Private Sub Extraccion()
Public IE As Object
Dim HTMLdoc As HTMLDocument
Dim frame As HTMLFrameElement
Set IE = CreateObject("InternetExplorer.Application")    
Set HTMLdoc = IE.document
Set frame = HTMLdoc.getElementsByName("HEXDESKTOP")(0)
Set HTMLdoc = frame.contentDocument      
For Each er In HTMLdoc.all
If er.innerText = "MANTENIMIENTOS" Then
er.Click
End If
Next er
    
asked by Jøelo 29.05.2017 в 18:22
source

0 answers