Created
June 11, 2015 19:14
-
-
Save ryancole/8c85c725f600766cec73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var html = new HtmlDocument(); | |
// load the document's html | |
html.LoadHtml(document.Html); | |
// create a string of the text only | |
document.Text = Regex.Replace(string.Join(" ", html.DocumentNode.SelectNodes("//text()").Select(m => m.InnerText)), @"\s+", " ").Trim(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment