I am experimenting with the HtmlAgilityPack. Currently I am trying to scrape data from a table in C#. I will be using xPath for this, but something seems not right.. I have tested my xPath query, and it is actually returning the correct data, but wehn I am trying to scrape from C# it returns null. Any ideas?
class Program
{
static void Main(string[] args)
{
var hw = new HtmlWeb();
HtmlDocument doc = hw.Load("http://www.filesignatures.net/index.php?page=all");
foreach (HtmlNode row in doc.DocumentNode.SelectNodes("//html//body//div[@id='container']//div[@id='body']//center//table//tbody//tr"))
{
Console.WriteLine(row.InnerText);
}
Console.ReadKey();
}
}