See the question and my original answer on StackOverflow

When scraping sites, you can't rely safely on the exact XPATH given by tools as in general, they are too restrictive, and in fact catch nothing most of the time. The best way is to have a look at the HTML and determine something more resilient to changes.

Here is a piece of code that works with your example:

    HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
    doc.Load(your html);

    foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//a[text()='MIA']/ancestor::tr/td[7]"))
    {
        Console.WriteLine(node.InnerText.Trim());
    }

It outputs 188.

The way it works is:

  • select an A element with inner text set to "MIA"
  • find the parent TR element of this A element
  • get to the seventh TD of this TR element
  • and then we use InnerText property of that TD element