title: C# Making program wait until browser finish loading webpage
body: <p>How do i make my program to wait until webpage finish loading before executing next statement. I tried Process::WaitForInputIdle(); but it doesn't wait.</p>
  
  <pre><code>ProcessStartInfo pInfo = new ProcessStartInfo("firefox.exe");
  
  pInfo.Arguments = "http://example.com";
  
  Process p  = Process.Start(pInfo);
  
  p.WaitForInputIdle();
  
  pInfo.Arguments = "http://example.net";
  
  p = Process.Start(pInfo);
  
  p.WaitForInputIdle();
  </code></pre>