title: How to get HTML from WebBrowser control
body: <p>There are loads of posts similar to this.</p>
  
  <p><a href="https://stackoverflow.com/questions/7333973/how-to-get-rendered-html-processed-by-javascript-in-webbrowser-control">How to get rendered html (processed by Javascript) in WebBrowser control?</a> suggests to use something like</p>
  
  <pre><code>webBrowser1.Document.GetElementsByTagName("HTML")[0].OuterHtml;
  </code></pre>
  
  <p><code>Document</code> is treated as an object, I have no option to use <code>GetElementsByTagName</code></p>
  
  <p><a href="https://stackoverflow.com/questions/2637192/copy-all-text-from-webbrowser-control">Copy all text from webbrowser control</a> suggests to use <code>DocumentText</code></p>
  
  <p>I have <code>Document</code> but no <code>DocumentText</code></p>
  
  <p>That post also suggests <code>webBrowser.Document.Body.InnerText;</code> </p>
  
  <p>I have the option to use <code>webBrowser.Document</code> but that is it. For some reason <code>webBrowser.Document</code> is an object and as such I can't access these methods.</p>
  
  <p><a href="https://stackoverflow.com/questions/5164733/getting-the-html-source-through-the-webbrowser-control-in-c-sharp">Getting the HTML source through the WebBrowser control in C#</a> also suggests using <code>DocumentStream</code>. Again, I don't have that.</p>
  
  <p>I'm doing this in a WPF application and using <code>WebBrowser</code> from <code>System.Windows.Controls</code></p>
  
  <p>All I'm trying to is read the rendered HTML from the web page.</p>
  
  <p>My code</p>
  
  <pre><code>public void Begin(WebBrowser wb)
  {
     this._wb = wb;
     _wb.Navigated += _wb_Navigated;
     _wb.Navigate("myUrl");
  }
  
  private void _wb_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
  {
      var html = _wb.Document;//this is where I need help
  }
  </code></pre>