I am trying to get web content by using HtmlAgilityPack but I am not getting entire contents.
Following is my code :
using HAP=HtmlAgilityPack;
using HtmlAgilityPack;
using (var client = new System.Net.WebClient())
{
var filename = System.IO.Path.GetTempFileName();
client.DownloadFile("http://www.cnn.com/", filename);
var doc = new HAP.HtmlDocument();
doc.Load(filename);
var root = doc.DocumentNode;
var a_nodes = root.Descendants("a").ToList();
foreach (var a_node in a_nodes)
{
Console.WriteLine();
Console.WriteLine(a_node.InnerText.Trim());
}
}
Console.ReadKey();
output:
https://i.stack.imgur.com/PJTV2.jpg
As you can see in screenshot that I am getting contents from tabs like Entertainment,Living, etc but nothing above that.
Any suggestions?