|
-
Jun 5th, 2010, 02:10 PM
#1
Thread Starter
Lively Member
web browser invoke member click
Hello. I am making a WoW automatic trial account creator and so far i have it so that on this link:
https://us.battle.net/account/creation/wow/signup/
it will fill out all of the information.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Document.All("firstName").InnerText = txtFirstName.Text
WebBrowser1.Document.All("lastName").InnerText = txtLastName.Text
WebBrowser1.Document.All("emailAddress").InnerText = txtEmail.Text
WebBrowser1.Document.All("emailAddressConfirmation").InnerText = txtEmail.Text
WebBrowser1.Document.All("password").InnerText = txtPass.Text
WebBrowser1.Document.All("passwordConfirmation").InnerText = txtPass.Text
WebBrowser1.Document.All("touAgree").SetAttribute("checked", "true")
End Sub
The only problem I am having is that when I try to make it automatically submit it isnt working because I can't find the id of the button. When I inspect it on the website it is a javascript button and I am not sure how to make it click.
I tried
Code:
'WebBrowser1.Document.All("Submit").InvokeMember("click")
But it still didn't work. Any help would be much appreciated! Thanks
-
Jun 5th, 2010, 03:54 PM
#2
Thread Starter
Lively Member
Re: web browser invoke member click
*BUMP*
Also, will javascript even work in the webbrowser?
-
Jun 5th, 2010, 08:23 PM
#3
Re: web browser invoke member click
try this:
vb Code:
For Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("a")
If element.GetAttribute("className") = "submit" Then
element.InvokeMember("click")
End If
Next
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 6th, 2010, 06:35 PM
#4
Thread Starter
Lively Member
Re: web browser invoke member click
 Originally Posted by .paul.
try this:
vb Code:
For Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("a")
If element.GetAttribute("className") = "submit" Then
element.InvokeMember("click")
End If
Next
it still doesn't press the submit button. I inspected the element and it has no id its just a javascript thing.
-
Jun 6th, 2010, 06:37 PM
#5
Thread Starter
Lively Member
Re: web browser invoke member click
<a xmlns="http://www.w3.org/1999/xhtml" href="javascript:;" onclick="Form.submit(this);" class="submit" style="">
Play Free Trial
</a>
-
Jun 6th, 2010, 06:40 PM
#6
Re: web browser invoke member click
<a xmlns="http://www.w3.org/1999/xhtml" href="javascript:;" onclick="Form.submit(this);" class="submit" style="">
Play Free Trial
</a>
tagName = a
className = submit
i tested it. it worked
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 6th, 2010, 11:35 PM
#7
Thread Starter
Lively Member
Re: web browser invoke member click
oh i tried and it didnt work. ill try again
-
Jun 6th, 2010, 11:43 PM
#8
Thread Starter
Lively Member
Re: web browser invoke member click
Okay, I tried it but it seems that it only presses submit if the boxes are empty. If the boxes are filled up with information and then i do that code to press submit it just does nothing. Any ideas?
-
Jun 7th, 2010, 09:26 AM
#9
Re: web browser invoke member click
there's something wrong with the website. i filled all the fields correctly, then clicked the button manually + nothing happened. i'd say the website isn't working properly.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|