Parsing results from HTMLAgiltyPack
See the question and my original answer on StackOverflowYou just need to continue some XPATH extraction work from where you are. There are many possibilities. The difficulty is all the yfnc_tabledata1 nodes are at the same level. Here is how you can do it (in a console app example it will dump the list of symbols and companies):
HtmlAgilityPack.HtmlDocument page = new HtmlWeb().Load("http://uk.finance.yahoo.com/q/cp?s=%5EFTSE");
// get directly the symbols under the 1st TD element. Recursively search for an A element that has an HREF attribute under this TD.
var symbols = page.DocumentNode.SelectNodes("//td[@class='yfnc_tabledata1']//a[@href]");
foreach (var symbol in symbols)
{
// from the current A element, go up two level and get the next TD element.
var company = symbol.SelectSingleNode("../../following-sibling::td").InnerText.Trim();
Console.WriteLine(symbol.InnerText + ": " + company);
}
More on XPATH axes here: XPATH Axes