Reputation: 1
I'm trying to create a simple vbs file to have multiple websites auto login with just one click. Problem is I cant get the website to automatically press enter/submit after it puts in the username and pw.
Call Main
Function Main
Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
IE.Visible = True
Wait IE
With IE.Document
.getElementByID("username").value = "username"
.getElementByID("password").value = "password"
.getElementsByClassName("login_button")(0).Submit
End With
End Function
Sub Wait(IE)
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
End Sub
Any help would be greatly appreciated. :)
Upvotes: 0
Views: 861
Reputation: 528
try
.getElementsByClassName("login_button")(0).Click
or
.forms(0).submit
Upvotes: 1