title: Wait until specific elements loaded
body: <p>I am trying to scrape a website and there are many elements I am dealing with. I need to wait for elements to be loaded.</p>
  
  <p>This is my try till now but I am waiting a long time and sometimes I get errors.</p>
  
  <pre><code>.FindElementById("ContentPlaceHolder1_Button1").Click
  .Wait 2000
  GoBack1:
  Set elePrint = .FindElementById("IconImg_CrystalReportViewer1_toptoolbar_print", timeout:=20000, Raise:=False)
  If elePrint Is Nothing Then
      Application.Wait Now() + TimeValue("00:00:01"): GoTo GoBack1
  Else
      elePrint.Click
  End If
  GoBack2:
  Set eleExport = .FindElementById("theBttnbobjid_1545642213647_dialog_submitBtn", timeout:=20000, Raise:=False)
  If eleExport Is Nothing Then
      Application.Wait Now() + TimeValue("00:00:01"): GoTo GoBack2
  Else
      eleExport.Click
  End If
  </code></pre>
  
  <p>Is there a better way for doing this?</p>
  
  <p>This is the html part</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;tbody&gt;&lt;tr valign="middle"&gt;&lt;td height="21" width="5" style="background-image:url('aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/../dhtmllib/images/skin_standard/button.gif');background-position:0px 0px;"&gt;&lt;/td&gt;&lt;td id="theBttnCenterImgbobjid_1545656314367_dialog_submitBtn" align="center" class="wizbutton" style="padding-left:3px;padding-right:3px;background-image:url('aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/../dhtmllib/images/skin_standard/button.gif');background-position:0px -42px;"&gt;&lt;nobr&gt;&lt;a id="theBttnbobjid_1545656314367_dialog_submitBtn" href="javascript:void(0)" class="wizbutton" role="button"&gt;Export&lt;/a&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;td height="21" width="5" style="background-image:url('aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/../dhtmllib/images/skin_standard/button.gif');background-position:0px -21px;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;</code></pre>
  </div>
  </div>
  </p>