Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72502

Make WebBrowser click a button on a webpage with a specific class ONCE in VB.net

$
0
0

I'm trying to make the webbrowser click on a specific button within a webpage:

The html code for the button is something like <a class="btn btn-large play"> and the code I have so far to click this button is:

For Each Element As HtmlElement In WebBrowser2.Document.GetElementsByTagName("a")
If Element.OuterHtml.Contains("btn btn-large play") Then
Element.InvokeMember("click")
End If

This works, but it makes the Webbrowser click the button again and again. Any idea how I can only make it do so twice?


Viewing all articles
Browse latest Browse all 72502

Trending Articles



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