1
I have the following HTML code:
<div class="dados">
<span><strong>Nome:</strong> Yuri Santos</span>
<span><strong>E-mail:</strong> [email protected]</span>
<span><strong>Endereço:</strong> Rua treze</span>
<span><strong>Cidade:</strong> Dos Sonhos</span>
</div>
And using a WebBrowser I want to take the values that are within a certain span.
However, I want to select which ones, e.g.: Name, Email.
I have the following code:
For Each h As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
        If Not Object.ReferenceEquals(h.GetAttribute("className"), Nothing) AndAlso h.GetAttribute("className").Equals("dados") Then
            txtDados.Text = h.InnerText
            Exit For
        End If
   Next
However, it takes all values (name, email, address, city).
Like they don’t have ID or nome, i don’t know how to identify them to catch only the ones I want.
Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?
– Maniero