Take a look at HTML Agility Pack , an HTML parser that you can use to extract InnerTextfrom HTML nodes into a document.
, SO, HTML . , ( ); , HTML . HTML .
, HAP, . A () , :
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.Load("path to your HTML document");
StringBuilder content = new StringBuilder();
foreach (var node in doc.DocumentNode.DescendantNodesAndSelf())
{
if (!node.HasChildNodes)
{
sb.AppendLine(node.InnerText);
}
}
XPATH , node :
var nodes = doc.DocumentNode.SelectNodes("your XPATH query here");
, .