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 get the values that are within a given span
.
However, I want to select what are, eg, 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).
As they do not have ID
or nome
, I do not know how to identify them to get only the ones I want.