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

VS 2012 Click a HTML button

$
0
0
Hey Guys,

i have a problem. I want to click a button on a website but i only have limited information about the button. All i have is:
Code:

<button onclick=";return true;" class=" yt-uix-button yt-uix-button-default yt-uix-button-size-default" type="submit" role="button"> <span class="yt-uix-button-content"> Posten </span> </button>
My VB code to click that button is
Code:

Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
    For Each element As HtmlElement In allelements
        If element.GetAttribute("class") = " yt-uix-button yt-uix-button-default yt-uix-button-size-default" Then
            element.InvokeMember("click")
        End If
    Next

I think it should work but here is the problem now: When im using the program, there are always javascript error messages popping up and they keep the browser loading and dont let the program work
Would be cool if anybody can help me with this ;)

Viewing all articles
Browse latest Browse all 27453

Latest Images

Trending Articles



Latest Images

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