HTML Agility Pack - Get all links of a class
See the question and my original answer on StackOverflowA code like this in a Console Application will dump the content of the HREF attribute for all A nodes (at any level in the whole document) with a CLASS attribute equal to 'dn-index-link' (Click here for a good XPATH tutorial):
HtmlDocument doc = new HtmlDocument();
doc.Load("mytest.htm");
foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//a[@class='dn-index-link']"))
{
Console.WriteLine("node:" + node.GetAttributeValue("href", null));
}