title: extracting just page text using HTMLAgilityPack
body: <p>Ok so i am really new to XPath queries used in HTMLAgilityPack.</p>
  
  <p>So lets consider this page <a href="http://health.yahoo.net/articles/healthcare/what-your-favorite-flavor-says-about-you" rel="noreferrer">http://health.yahoo.net/articles/healthcare/what-your-favorite-flavor-says-about-you</a>. What i want is to extract just the page content and nothing else.</p>
  
  <p>So for that i first remove script and style tags.</p>
  
  <pre><code>Document = new HtmlDocument();
          Document.LoadHtml(page);
          TempString = new StringBuilder();
          foreach (HtmlNode style in Document.DocumentNode.Descendants("style").ToArray())
          {
              style.Remove();
          }
          foreach (HtmlNode script in Document.DocumentNode.Descendants("script").ToArray())
          {
              script.Remove();
          }
  </code></pre>
  
  <p>After that i am trying to use //text() to get all the text nodes.</p>
  
  <pre><code>foreach (HtmlTextNode node in Document.DocumentNode.SelectNodes("//text()"))
          {
              TempString.AppendLine(node.InnerText);
          }
  </code></pre>
  
  <p>However not only i am not getting just text i am also getting numerous /r /n characters. </p>
  
  <p>Please i require a little guidance in this regard.</p>