Parsing li> in HTML Agility Pack

.net c# html-agility-pack html-parsing

Question

I want to get a list of information from a straightforward webpage. All of the information is included in a<li> tag. I want to implement this with HTML Agility Pack, but how? Exists a more effective strategy?

The only items included in<li> Only the facts are included in tags.

1
4
5/19/2009 8:16:19 AM

Accepted Answer

the following

List<string> facts = new List<string>();
foreach (HtmlNode li in doc.DocumentNode.SelectNodes("//li")) {
    facts.Add(li.InnerText);
}
5
5/19/2009 9:01:25 AM


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