I have searched the web tying to figure out why my code for this doesn't work. I am trying to automate a set of commands on a website, but am having issues just getting it to login. It shows me an error at the following point in .Key.Value = "mylogin" saying object doesn't support
My Code is
Here is the relevant code from the source code
My Code is
Code:
Sub login()
Dim ie As InternetExplorer
Dim C
Dim ULogin As Boolean, ieForm
Dim MyPass As String, MyLogin As String
Dim ieDoc As Object
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "https://www.foreclosure.com/login"
'Loop until ie page is fully loaded
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
Set ieDoc = ie.Document
With ieDoc.forms(0)
.Key.Value = "mylogin"
.Password.Value = "mypass"
.submit
End With
Do While ie.Busy: DoEvents: Loop
Do Until ie.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Do While ie.Busy: DoEvents: Loop
Do Until ie.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
'ie.Quit
Set ie = Nothing
End Sub
Here is the relevant code from the source code
HTML:
*********><div class="container"><div class="row"><div class="col-md-6 col-md-offset-1"><h3>Sign In</h3><div id="contEmailPassword"><p class="bp_10">Enter your email and password below:</p><form name="login" id="login_password" action="https://www.foreclosure.com/login.html" method="post" style="margin-bottom: 0px;"><fieldset><div class="form-group control-group"><input autocomplete="on" name="key" type="text" value="" placeholder="Email" class="form-control bm_0 required"></div><div class="form-group control-group"><input name="password" size="20" value="" autocomplete="on" type="password" id="password" style="margin-bottom:0px;" placeholder="Password" class="form-control required"></div><div class="form-group control-group"><input type="submit" class="btn btn-primary" value="Sign In" id="btnLoginUsernamePassword" style="margin-bottom:0px;"/><span style="margin-left:10px;"><a href="/lostpassword.html">Forgot Password?</a></span></div>
Last edited: