Use predicates in HtmlAgilityPack, Xpath
See the question and my original answer on StackOverflowThis kind of code:
HtmlDocument doc = new HtmlDocument();
doc.Load(myHtmlFile);
foreach (HtmlNode node in doc.DocumentNode.SelectNodes(
"//div[@class='list3' and position() > 2 and position() < 6]/a[@class='href1']"))
{
Console.WriteLine("node:" + node.InnerText);
}
will give you this result:
node:A3
node:A4
node:A5