Using HTML Agility Pack to get text next to image?
See the question and my original answer on StackOverflowThe following code:
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.Load(yourHtml);
foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//img"))
{
Console.WriteLine(HtmlEntity.DeEntitize(node.NextSibling.InnerText).Trim());
}
Will output:
x 3
1
x 1
x 1
Note the HtmlEntity utility that eases the handling of HTML entities (like )