Hi Guys,
I've been trying to auto certain processes and i'm trying to automatically login to a certain website. Below is my VBA code and the java script of the website. Until the line when its suppose to insert the userid and password, an error appeared. Appreciate any advise
End Sub
Thanks!
I've been trying to auto certain processes and i'm trying to automatically login to a certain website. Below is my VBA code and the java script of the website. Until the line when its suppose to insert the userid and password, an error appeared. Appreciate any advise
HTML:
<form id="login-form" name="login-form" action="/client-portal-admin/j_spring_security_check" method="POST"> <div class="control-group"> <label for="j_username" class="control-label">User id:</label> <input type="text" name="j_username" placeholder="User id" maxlength="100" required /> </div> <div class="control-group"> <label for="j_password" class="control-label">Password:</label> <input type="password" name="j_password" placeholder="********" maxlength="100" required /> </div> <div class="control-group"> <button type="submit" class="btn btn-orange"><i class="icon-lock icon-white"></i> Login</button> </div> </form>
Code:
Sub CP()
Set ie = CreateObject("InternetExplorer.Application")
my_url3 = "website"
With ie
.Visible = True
.Navigate my_url3
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
End With
Application.Wait (Now + TimeValue("0.00:03"))
On Error Resume Next
ie.document.getElementsByName("overridelink").Item.Click
On Error GoTo 0
Application.Wait (Now + TimeValue("0.00:05"))
ie.document.getElementByClassName("text").Value = "xyz"
ie.document.getElementByClassName("password").Value = "123"
End Sub
Thanks!