Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

(TuT) How to click a button that doesn’t have an ID in Webbrowser (/TuT) (VB.NET)

Hello g,

This tutorial will show you how to click a button that doesn’t have an ID. You just need the button's name.

1. Requirement :

- a computer (lol)
- a Visual Basic Project with : a form,
a webbrowser, and
_ a button.

2. Start tutorial :

A. Just put in Form_Load :
Code
WebBrowser1.Navigate("http://login.facebook.com/login.php")

B. In Button_Click put :
Code
Dim a As HtmlElementCollection = WebBrowser1.Document.All

For Each b As HtmlElement In a
    If b.GetAttribute("value") = "Log In" Then

    b.InvokeMember("click")

    End If
  Next

Source : http://howtostartprogramming.com/vb-net/...ithout-id/

I hope you like this tutorial
Sorry for my bad english :/

For Each Elements As HtmlElement In WebBrowser1.Document.All()
If Elements.GetAttribute("name") Like "submit" Then
Elements.InvokeMember("click")
End If
Next
I just want to help you :(
If this tut is not good, i will delete it ...


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by The Pulp FictionApr 24, 2022 12:22 AM 2 200 Apr 24, 2022 12:22 AM
Last Post: The Pulp Fiction
[.NET] by triplextremeSep 15, 2020 02:29 PM 7 223 Sep 15, 2020 02:29 PM
Last Post: Dredd
[.NET] by requiredhqMay 27, 2020 08:38 AM 2 105 May 27, 2020 08:38 AM
Last Post: Yui Hirasawa