title: Collecting element in table after invoke the click, using c# in webBrowser
body: <p>How I collecting element in table after invoke the click event using C# in webBrowser.</p>
  
  <p>My syntax command for invoke the click is:</p>
  
  <pre><code>webBrowser1.Document.GetElementById("addressSearchButton").InvokeMember("Click");
  </code></pre>
  
  <p>They put the result in table with ID : address-details   </p>
  
  <p>Here the fragmented of HTML, Before Search clicked:</p>
  
  <pre><code>&lt;div id="search-result-outer" style="width: 100%"&gt;
  &lt;div id="search-result"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>and after search clicked :</p>
  
  <pre><code>&lt;div id="search-result-outer" style="width: 100%"&gt;
  
  &lt;div id="search-result"&gt;
          &lt;div id="search-header"&gt;
              &lt;h2&gt;Search results&lt;/h2&gt;
          &lt;/div&gt;
          &lt;div id="manage-addresses"&gt;
                  &lt;div id="address-details_wrapper" class="dataTables_wrapper" role="grid"&gt;
                      &lt;div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"&gt;...&lt;/div&gt;
                      &lt;table id="address-details" class="address-details dataTable" aria-describedby="address-details_info"&gt;...&lt;/table&gt;
                      &lt;div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"&gt;...&lt;/div&gt;                      
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>The question is : How to wait until the result come-out, and start collecting the result element?</p>
  
  <p>I can't get result directly after invoke the click, because the table not come-out yet.</p>
  
  <p>I tried to wait using ReadyState.Complete, but not hope. </p>
  
  <pre><code>while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
          {
              Application.DoEvents();
          }
  </code></pre>
  
  <p>I also tried to checking result element using loop, but it make the webBrowser stuck.</p>
  
  <pre><code>while (webBrowser1.Document.GetElementById("address-details") == null)
  { 
  Application.DoEvents(); 
  }
  </code></pre>