Quantcast
Channel: Visio General Questions and Answers for IT Professionals forum
Viewing all articles
Browse latest Browse all 2333

VB.NET get the specific attribute/class I want and click

$
0
0

<div class="wallet_action" data-ember-action="1097">
<i class ="fa fa-send">..</i>
"Send"

<div class="wallet_action" data-ember-action="1098">
<i class ="download">..</i>
"Request"

How to invoke member on this one, I want to invoke/click the button on the "Send" part of the "Request". I can't make it work, want to get the specific class attribute I desired

PS: The number "1097" and "1098" is not constant, it changes from time to time. How can I click the "Send" / "Request"> Other way that I won't be using the "1097" or "1098" as ToString.

Here's my code for now:

Dim theElementCollection As HtmlElementCollection = Nothing
        theElementCollection = WebBrowser1.Document.GetElementsByTagName("div")
        For Each curElement As HtmlElement In theElementCollection
            If InStr(curElement.GetAttribute("data-ember-action").ToString, "1098") Then

                curElement.InvokeMember("click")
                Timer1.Enabled = False
            End If
        Next

Viewing all articles
Browse latest Browse all 2333

Trending Articles



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