title: c# Webbrowser control cannot get generated HTML source
body: <p>I am trying to get data (which is generated by scripts) and I am using webbrowser control applied the introduction from: <a href="https://stackoverflow.com/questions/18333459/c-sharp-webbrowser-ajax-call/18333982#18333982">C# webbrowser Ajax call</a></p>
  
  <p>My 1st main code is:</p>
  
  <pre><code>webBrowser1.Navigate("https://mobile.bet365.com/#type=Coupon;key=1-1-13-33977144-2-8-0-0-1-0-0-4100-0-0-1-0-0-0-0-0-0-0-0;ip=0;lng=1;anim=1");
  while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
  {
      System.Threading.Thread.Sleep(10);
      Application.DoEvents();
  }
  File.WriteAllText(@"C:\pagesource.txt", webBrowser1.DocumentText);
  </code></pre>
  
  <p>The page source I got is not what the browser showed.
  When I modify the code like below:</p>
  
  <pre><code>webBrowser1.Navigate("https://mobile.bet365.com/#type=Coupon;key=1-1-13-33977144-2-8-0-0-1-0-0-4100-0-0-1-0-0-0-0-0-0-0-0;ip=0;lng=1;anim=1");
  while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
  {
      System.Threading.Thread.Sleep(10);
      Application.DoEvents();
  }
  MessageBox.Show("Loading completed");
  File.WriteAllText(@"C:\pagesource.txt", webBrowser1.DocumentText);
  </code></pre>
  
  <p>and of course I have to press OK when the dialog is shown. The page source is correct now.</p>
  
  <p>I don't understand how can it be like that. And I just want to get the page source automatically (without any clicks or user actions).</p>