Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27020

Clicking a button without id on webbrowser

$
0
0
Im trying to click 2 buttons in WebBrowser1 and Webbrowser2

I have been searching for an hour, and i have been trying different things, but none of them worked.
I thought this would work (Cause it works when i try to click an image)

Code:

  Dim allelements As HtmlElementCollection = WebBrowser1.Document.All

        For Each webpageelement As HtmlElement In allelements
            If webpageelement.GetAttribute("class") = "flat-button flat-button-mini flat-button-inverse js-submit" Then
                webpageelement.InvokeMember("click")
            End If
        Next

But it doesnt.

This is the button im trying to click:
HTML Code:

<div class="flat-button flat-button-mini flat-button-inverse js-submit">Submit</div>

Im also trying the same with the button:
HTML Code:

<button class="btn">
          Login
        </button>


Viewing all articles
Browse latest Browse all 27020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>