Click on website button with tag "button"


Joined
Aug 26, 2017
Messages
1
Reaction score
0
Here is the HTML portion of website form:
<form autocomplete="off" target="_top" name="form-login" method="post" id="form-login" enctype="application/x-www-form-urlencoded" action="https://invest.ameritrade.com/grid/p/login">

<input value="" type="hidden" name="DV_DATA"><input type="hidden" name="fp_browser"><input type="hidden" name="fp_screen"><input type="hidden" name="fp_software"><input type="hidden" name="fp_timezone"><input type="hidden" name="fp_language"><input type="hidden" name="fp_java"><input type="hidden" name="fp_cookie"><input type="hidden" name="flashVersion"><input value="" type="hidden" name="AgentID"><input value="submit" type="hidden" name="mAction"><input id="loginAction_invokedFrom" value="" name="invokedFrom" type="hidden"><input id="loginAction_symbolList" value="" name="symbolList" type="hidden"><input id="loginAction_source" value="" name="source" type="hidden">

<div class="main-header-login-fields">

<input name="tbUsername" id="userid" placeholder="User ID" class="main-header-login-username" type="text" tabindex="3">

<input name="tbPassword" id="password" placeholder="Password" class="main-header-login-password" type="password" tabindex="4">

<button target="_self" tabindex="5" id="" class="" type="submit" value="Log in" title="Log in" href="https://invest.ameritrade.com/grid/p/login">

</button>


Now here is what I've tried:

Set doc = IE.Document
Set LogonForm = doc.forms(0)
Set UserNameInputBox = LogonForm.elements("tbUsername")
UserNameInputBox.Value = my_username

Set PasswordInputBox = LogonForm.elements("tbpassword")
PasswordInputBox.Value = my_pw
'LogonForm.submit 'this expels!

Set SigButEl = doc.all.Item("Log in")
doc.getElementsByTagName("button")(0).Click 'error 91
doc.getElementsByTagName("button")(0).submit 'error 91
SigButEl.Click 'error 91

Dim l
doc.getElementsByClassName("main-header-login-submit btn btn-green-solid")(4).innerHTML
For Each l In doc.getElementsByClassName("main-header-login-submit btn btn-green-solid")
If l.Value = "Log in" Then
l.Click
Exit For
End If
Obviously, i need help!
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top