title: How can I find a specific div by name in an HTMLDocument?
body: <p>I am really having a hard time navigating through all the properties in the <code>HTMLDocument</code> class. I have a Web page I am loading in a WPF <code>WebBrowser</code> embedded in a <code>Window</code>. I have an event like</p>
  
  <pre><code>    private void _browser_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
      {
          HTMLDocument document = (HTMLDocument) this._browser.Document;
          if (document.body != null)
          {
              this.Height = //get the div with the id 'wrapper' and get it's height
          }
      }
  </code></pre>
  
  <p>Basically. when the page is done with navigating, I want to get the height of a specific divider in the HTML.</p>
  
  <p>Here is how the HTML looks like:</p>
  
  <pre><code>&lt;html lang="en-US"&gt;
      &lt;head&gt;…&lt;/head&gt;
      &lt;div id = "wrapper"&gt;…&lt;/div&gt;
      &lt;body blah blah blah&gt;…&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It seems that I can't find this HTML, though it is in the <code>HTMLDocument</code> class. I want to get the height of this divider and set the window height to the height of this divider plus whatever other space for buttons and other things are required.</p>
  
  <p>Where should I search for?</p>
  
  <p>At first, I was trying</p>
  
  <pre><code>HTMLDocument document = (HTMLDocument) this._browser.Document;
  this.Height= document.body.offsetHeight
  </code></pre>
  
  <p>but this was nowhere near correct, and I can't seem to find anything of the type <code>HTMLElement</code> that I have read, where you can access individual <code>HTMLElement</code>s.</p>
  
  <p>If you have worked with this class before or can see where I am going wrong, any help would be greatly appreciated.</p>