There are 2 key classes to know, besides HtmlDocument ofcourse.
To "read" the nodes of a HtmlDocument, use DocumentNode property. DocumentNode is a HtmlNode object.
Another important thing to KNOW about is that SelectSingleNode and SelectNodes return null when no nodes are found. So in this code, you should test for null. Pretend table.SelectNodes("./tr") returns null, and there are 3 tables in the html document,
your code will not go past the first one, and throw an exception.
HtmlDocument doc = HtmlWeb.Load("sample.html");
foreach(HtmlNode table in doc.SelectNodes("//table"))
foreach(HtmlNode tr in table.SelectNodes("./tr"))
HtmlNodeCollection tds = tr.SelectNodes("./td");
if(tds == null )
I am writing this off my mind, so it might not compile at all. But it is just a reference sample.
If you add the HAP project to your solution, you can more easily figure out how HAP works than using only the HtmlAgilityPack.dll.