From File

Load Html From File

HtmlDocument.Load method loads an HTML document from a file.

Example

The following example loads Html from file.

var path = @"test.html";
		
var doc = new HtmlDocument();
doc.Load(path);

var node = doc.DocumentNode.SelectSingleNode("//body");

Console.WriteLine(node.OuterHtml);	

Click here to run this example.