title: Click on HTML element and generate pop-up
body: <p>I'm running an Excel VBA macro that collects information from <a href="http://www.omahasteaks.com/product/Bacon-Wrapped-Filet-Mignons-4-5-oz-01144?ITMSUF=WZB" rel="nofollow noreferrer">this webpage</a>.  To get the pricing information to appear, you need to click on the box labeled &quot;5 oz. - 4 Count&quot; over on the right side, middle of the page.  Once you click on the box a pop-up window appears with the desired information.</p>
  <p>My problem is that I have been unable to figure out how to programmatically click on this box.</p>
  <p>From examining the page elements, it seems that the following element</p>
  <pre><code>&lt;a class=&quot;os_opt_dd&quot; href=&quot;#&quot;&gt;&lt;span class=&quot;os_opt_dd_s&quot;&gt;5 oz. - 4 Count&lt;/span&gt;&lt;input tabindex=&quot;-1&quot; value=&quot;1144&quot;&gt;&lt;/a&gt;
  </code></pre>
  <p>contains the clickable element that generates the pop-up, but when I try to programmatically click it (as in the code shown below) nothing happens.</p>
  <pre><code> my_url=&quot;http://www.omahasteaks.com/product/Bacon-Wrapped-Filet-Mignons-4-5-oz-01144?ITMSUF=WZB&quot;
  
   Set ie = CreateObject(&quot;InternetExplorer.Application&quot;)     
     With ie    
       .Visible = True
       .navigate my_url
       .Top = 50
       .Left = 530
       .Height = 400
       .Width = 400
    End With
    
    ie.document.getelementsbytagname(&quot;a&quot;)(0).Click
  </code></pre>
  <p>When I tried looping through all the elements on the page with the following code, I was able to click on the box and generate the pop-up. But if I refreshed the web page, the value of x that generated the pop-up would be different.</p>
  <pre><code>For x = 0 To ie.document.all.Length - 1
      ie.document.all.Item(x).Click    ' x=1101, 1103 and 1190, 1223 often seemed to generate the pop-up
  Next
  </code></pre>
  <p>Can someone show me how to click on the box in a manner that is repeatable?</p>