Thursday, June 12, 2014

Crawling a web sites with HtmlAgilityPack

This is the part that I wanted to lay emphasis onto, as follows:

Linq to Objects approach

public string GetInnerTextWithLinq() {   var document = new HtmlDocument();   document.Load(new FileStream("test.html", FileMode.Open));   var node = document.DocumentNode.Descendants("div").Where(     d => d.Attributes.Contains("class") && d.Attributes["class"].Value.Contains("required")).SingleOrDefault();   return node.InnerText; }
Check the link for more details and feel free to add your comments
Crawling a web sites with HtmlAgilityPack
Post a Comment

Know us

Our Team


Video of the Day

Contact us


Email *

Message *