Could anyone please help to parse Html with Agility pack into a single string ?
I'm trying to parse Html similar to following format,
<blockquote>\n <p>Here is the first collection:<\/p>\n <ol>\n <li>List1<\/li>\n <li>List2<\/li>\n <li>List3<\/li>\n <\/ol>\n <p>Here is the second collection:<\/p>\n <ol>\n <li>List1<\/li>\n <li>List2<\/li>\n <\/ol>\n <\/blockquote> I try to use following method to get "p" and "li" and "blockquote". However, method .Descendants creates individual collections for "p", "li", and "blockquote", but I need to put individual element in sequence and store them in a single string.
IEnumerable<HtmlNode> h3Tags = document.DocumentNode.Descendants("p"); foreach (var h3tag in h3Tags) {} for instance, I want my string stores, "Here is the first collection: List1 List2 List3 Here is the second collection List1 List2".
Thank you!