I'm trying to get the "value" inside the div to put inside a Label.
Div:
<div class="info">valor</div>
First Attempt
Variavel1 = WebBrowser1.Document.GetElementById("info").GetAttribute("innerText")
Label1.Text = Variavel1
Second Try
For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
If Element.OuterHtml.Contains("class") = "info" Then
Variavel1 = Element.GetAttribute("innerText")
Return
End If
Next
Label1.Text = Variavel1
I discovered that on the page there are several "Info" classes ...
Thiscodeworked,butitbroughtanotherresultthanexpected...
DimtheElementCollectionAsHtmlElementCollectiontheElementCollection=WebBrowser1.Document.GetElementsByTagName("Div")
For Each curElement As HtmlElement In theElementCollection
If curElement.OuterHtml.Contains("info") Then
Variavel1 = (curElement.GetAttribute("InnerText"))
End If
Next
Label1.Text = Variavel1
The result was the value of this Div that also has the class "info".
<div class="msg"><div class="info">OMG/BTC and OMG/ETH OmiseGO markets added</div>