title: Need to click on search button in a website using vba
body: <p>I tried several methods to click the submit button using vba macro but not a single method worked for me. Finally i decided to post my concern here to seek advice.</p>
  
  <p>The website is realtor.com</p>
  
  <p>I populated the search box with my data from excel sheet using vba. now i am unable to hit the search button. i tried with the following vba code</p>
  
  <pre><code>Dim objTag As Object
  
  For Each objTag In html.getElementsByTagName(strTagName)
      If InStr(objTag.outerHTML, "btn btn-primary js-searchButton") &gt; 0 Then
          objTag.submit
          Exit For
      End If
  Next
  </code></pre>
  
  <p>but it did not work for me.</p>
  
  <p>Html code is   </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;form class="inline-form" action="/search" accept-charset="UTF-8" method="get"&gt;&lt;input name="utf8" type="hidden" value="&amp;#x2713;" /&gt;
  &lt;div class="input-group search-input-group search-input-prepopulate"&gt;
    &lt;input name="q"
           type="text"
           id="searchBox"
           class="form-control user-input-box"
           placeholder="Address, City, Zip, or Neighborhood"
           value=""
           autocomplete="off"
           autocorrect="off"
           autocapitalize="off"
           spellcheck="false"
     /&gt;
  
      &lt;input id="autocomplete" type="text" class="form-control pre-populate-box" tabindex="-1"/&gt;
  
    &lt;span class="input-group-btn"&gt;
      &lt;button id="clearInput" class="btn btn-link btn-clear-input hide"&gt;
        &lt;i class="ra ra-close-thin"&gt;&lt;/i&gt;
      &lt;/button&gt;
        &lt;button class="btn btn-primary js-searchButton" type="submit"&gt;
          &lt;i class="ra ra-search"&gt;&lt;/i&gt;
            &lt;span class="hidden-xxs hidden-xs"&gt;Search&lt;/span&gt;
        &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>`
  It will be a great help for me if anyone helps me out here. Thanks in advance.</p>