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.OptionDefaultStreamEncoding = Encoding.UTF8; 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();
<a>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)