HtmlAgilityPack - get all nodes in a document

kiki picture kiki · Feb 2, 2012 · Viewed 12.2k times · Source

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

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

do?

Answer

SLaks picture SLaks · Feb 2, 2012

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