Convert Html string to node collection using HtmlAgilityPack

c# html-agility-pack vb.net xpath

Question

I have this html. I want to get list of node using html agility pack.

<span prop="name">Richard Winchester</span>
<span prop="company">Kodak</span>
<span prop="street">Arlington Road 1</span>

I tried this

Dim doc = New HtmlAgilityPack.HtmlDocument()
doc.LoadHtml(AboveHtmlInString)
Dim nodes = doc.DocumentNode.ChildNodes

But I am not getting collection of nodes.

1
1
10/28/2015 10:42:24 AM

Popular Answer

Your above code should work. I have made an identical representation in C# and it compiles and works as intended. It might be a visual basic issue.

HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(AboveHtmlString);
HtmlNodeCollection nodes = doc.DocumentNode.ChildNodes;
1
11/9/2015 11:35:16 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow