
March 26th, 2012, 02:38 PM
|
|
Registered User
|
|
Join Date: Mar 2012
Posts: 2
Time spent in forums: 47 m 36 sec
Reputation Power: 0
|
|
How to get that button name?
Okay guys,
I've been making this program to log in to a web page, I have done so that it can write the inputed text in the username and password textboxes, using these comands:
Code:
Code:
webpage.Document.GetElementById("name").SetAttribute("value", username.Text)
webpage.Document.GetElementById("pass").SetAttribute("value", password.Text)
------------------------
The button clicking comand shuld be this:
Code:
Code:
webpage.Document.GetElementById("button-name").InvokeMember("click")
------------------------
But I can't get the button ID the same way i got the textboxes' ID, here is a snippet of the page:
The ID's of the textboxes are there (name="") but the button's ID isn't.
HTML Code:
Code:
</div>
<form action="/user/login" accept-charset="UTF-8" method="post" id="user-login">
<div><div class="content_frame" style="margin-right: 100px; margin-top: 15px;">
<div class="page_form_container">
<div class="form-item">
<label for="name" style="font-size: 16px; font-weight: bold;">Username:</label>
<input type="text" name="name" id="name" value="" />
</div>
<div class="form-item">
<label for="pass" style="font-size: 16px; font-weight: bold;">Password:</label>
<input type="password" name="pass" id="pass" value="" />
</div>
<input type="submit" value="Log In" style="margin-left: 150px; margin-right: 0px;" class="popup_button form-submit" />
<div class="popup_button" style="float: right; margin-right: 10px;">
<a href="http://signup.PAGE.com">Create Account</a> </div>
<div style="margin-bottom: 15px; margin-left: 150px; margin-top: 25px;">
<a href="/account/recovery/username">Forgot Username? | </a>
<a href="/account/recovery/password">Forgot Password?</a>
</div>
<input type="hidden" name="form_id" value="user_login" />
</div>
</div>
</div></form>
I need help fast,
Thanks for your time,
CrazyVB
|