title: Getting DOCTYPE using selenium webdriver C#
body: <p>I am using Selenium webdriver for UI automation purpose. Below is my sample code</p>
  
  <pre><code>IWebDriver driver = new OpenQA.Selenium.IE.InternetExplorerDriver();
      string url ="http://stackoverflow.com";
      driver.Navigate().GoToUrl(url);
      string pagesource = driver.PageSource;
  </code></pre>
  
  <p>pagesource variable does not have the doctype. I need to  know the DOCTYPE for <a href="http://validator.w3.org" rel="nofollow">W3C validation</a>. Is there any way to get DOCTYPE of html source through selenium?</p>
  
  <p><a href="https://groups.google.com/group/webdriver/browse_thread/thread/e8fc1d5b77ec3a9d" rel="nofollow" title="This thread">This thread</a> shows there is no way to get the Doctype of html source through selenium, instead you can do a HTTP request from .net and get the DOCTYPE. I don't want to do a seperate HTTP request for getting DOCTYPE. </p>