title: vbscript IE click on link in nav bar
body: <p>I need to click on a menu item in a nav bar that does not have any id or name that I can see. </p>
  
  <p>I tried clicking on the specific element but I get the error "object required".</p>
  
  <pre><code> ie.document.getElementById("toc_20003").Click
  </code></pre>
  
  <p>So I tried getting a collection of links or objects so I could see what my options were but nothing is displayed.</p>
  
  <pre><code> set oelm=ie.document.getelementsbyname("mainMenu")
   for each elm in oelm
        wscript.echo elm.id
   next
  </code></pre>
  
  <p>I also tried the above with ie.document.links(1) but nothing is displayed.</p>
  
  <p>Here is the html. The link I want is at the end "All Titles":</p>
  
  <p><code>&lt;div id="navBarContainer"&gt;&lt;div id="navBar"&gt;&lt;ul id="mainMenu"&gt;&lt;li id="toc_10000" class="CurrentSection CurrentPage Leaf"&gt;&lt;a href="page.aspx?location=HOME&amp;cache=10062000346"&gt;Home&lt;/a&gt;&lt;/li&gt;&lt;li id="toc_20000" class="Open"&gt;&lt;a href="javascript:;" onfocus="blur()" onclick="mainMenuClick('toc_20000', '')" title="Explore aggregate and per-title sales data for your titles and your competitors' titles."&gt;Sales Reports&lt;/a&gt;&lt;ul&gt;&lt;li id="toc_20003" class="Leaf"&gt;&lt;a href="puballeypage.aspx?location=ALLSRCH&amp;cache=10062000346" title="Sales for individual titles or groups of titles.  Compare your sales with competitors' sales."&gt;All Titles&lt;/a&gt;&lt;/li&gt;</code></p>
  
  <p>How do I click this? Also, the web page has just been repainted after the vbscript has logged onto the website. Do I need to do something to force the new page elements to be available?</p>
  
  <p>Any help appreciated. Thanks.</p>