title: C# How to open a webpage and click a button
body: <p>I have a problem to solve. </p>
  
  <p>A button has this code:</p>
  
  <pre><code>WebBrowser wb = new WebBrowser();
  wb.Navigate(link, true);
  wb.Document.GetElementById(idname).InvokeMember("click");
  </code></pre>
  
  <p>I have a NullReferenceException on the GetElementById because when I reach it, the page is "white". If I comment the GetElementById, the page is opened correctly.</p>
  
  <p>Thanks</p>