Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a rather complex web page wher I want to extract some information.
For exemple I have the following line

HTML
<div class="global-menu-name"><img src="img.png" /><a href="hhhhh">FirstName</a> <a href="kkkkk">Name</a></div>


I want to detect this line and extract the two links href and Firstname and Name

The code detects the "class"tags but not all and not the one Im looking for.

THanks for your help

Bernard

What I have tried:

I have tried with the following code

Function deoderHTML(ByRef HtmlDoc As HtmlDocument) As Boolean

Dim html As HtmlNode = HtmlDoc.DocumentNode.Element("html")
Dim divTags As Object = HtmlDoc.DocumentNode.Descendants()
For Each tag As HtmlNode In divTags
If tag.Attributes("class") IsNot Nothing Then
If tag.Attributes("class").Value = "global-menu-name" Then
Console.WriteLine(tag.Attributes("class").Value)
Stop
End If
End If
Next
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900