Html Agility Pack - Parsing <li>

I want to clear the fact list from a simple site. Each of the facts is enclosed in an <li> . How do I do this with the Html Agility Pack? Is there a better approach?

The only things enclosed in <li> tags are facts and nothing more.

+4
source share
1 answer

Sort of:

 List<string> facts = new List<string>(); foreach (HtmlNode li in doc.DocumentNode.SelectNodes("//li")) { facts.Add(li.InnerText); } 
+6
source

All Articles