How can I call onClick in a HTML page?
Using Google, I got this code:
<img src="Imagens/lupa.gif" alt="Pesquisar Pasta" class="img" onclick="localizar();">
I'm using this VBA code:
Sub FazerLoginSite()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
With IE
.Visible = True
.Navigate ("https://webseal.itau/j146/pjuridico/")
While .Busy Or .ReadyState <> 4: DoEvents: Wend
On Error Resume Next
.document.getElementById("username").Focus
.document.getElementById("username").Value = "987268556"
.document.getElementById("password").Focus
.document.getElementById("password").Value = ""
.document.All("button1").Click
On Error GoTo 0
While .Busy Or .ReadyState <> 4: DoEvents: Wend
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.getElementById("pasta").Focus
.document.getElementById("pasta").Value = "140200586125"
While .Busy Or .ReadyState <> 4: DoEvents: Wend
While .Busy Or .ReadyState <> 4: DoEvents: Wend
Set allInputs = IE.document.getElementsByTagName("input")
For Each element In allInputs
If element.getAttribute("src") = "Imagens/lupa.gif" Then
element.invokemember ("OnClick")
Exit For
End If
Next element
While .Busy Or .ReadyState <> 4: DoEvents: Wend
Debug.Print .LocationURL
End With
End Sub
How can I click on this code? In the web site this is an Image and the first part of the code I set my login and password, the I put a number to search, here called "Pasta", and finally I'm trying to click on this image.
