HtmlAgilityPack - get all nodes in a document

c# html-agility-pack xpath

Question

i would like to traverse all nodes in a documnet using HtmlAgilityPack will

foreach (HtmlNode node in myhtml.DocumentNode.SelectNodes("//@"))

do?

Popular Answer

You can just loop through myhtml.DocumentNode.Descendants().




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why