Ankur Kumar
New Member
Dear All,
I want to access a website with auto login without any click on webpage, here is my coding below please help how do i do it.
I want to access a website with auto login without any click on webpage, here is my coding below please help how do i do it.
Code:
Sub HTML_Element_Printer()
On Error GoTo Err_Clear
sURL = "https://www.instamojo.com/accounts/login"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 45
oBrowser.navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
HTMLDoc.all.id_login_username.Value = "ABC"
HTMLDoc.all.Password.Value = "AB@123"
For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
Debug.Print oHTML_Element.Name
Next
' oBrowser.Refresh ' Refresh If Needed
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub
Last edited by a moderator: