I'm trying to use VBA to login on site at work, with this code that I found on web.
Sub LoginSite()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.application")
With IE
.Visible = True
.Navigate ("``m``y site")
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.Document.getElementById("look the Login ID at site").Focus
.Document.getElementById("look the Login ID at site ").Value = "my user"
.Document.getElementById("look the Password ID at site").Focus
.Document.getElementById("look the Password ID at site").Value = "my password"
.Document.All("Verificar qual ID do Botão ").Click
While .Busy Or .ReadyState <> 4: DoEvents: Wend
Debug.Print .LocationURL
End With
End Sub
But when I look at codes of the site, there isn't ID names for Login or Password. As posted at links bellow
https://pixeldrain.com/u/yyswM5j8
https://pixeldrain.com/u/oxNJ8_Pi
https://pixeldrain.com/u/hfteWoWY
LOGIN: <INPUT style="HEIGHT: 22px; WIDTH: 102px" maxLength=11 name=Usuario>
PASSWORD: <INPUT style="HEIGHT: 22px; WIDTH: 102px" maxLength=10 type=password value="" name=Senha>
There is another way to fill the login and password without the ID name??
Edit1: If I fill the username field or password field, results this
