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 :)
Re: web browser invoke member click
*BUMP*
Also, will javascript even work in the webbrowser?
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
Re: web browser invoke member click
Quote:
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.
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>
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
Re: web browser invoke member click
oh i tried and it didnt work. ill try again :p
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?
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.