title: Execute javascript in webbrowser control
body: <p>I am trying to resolve the links in a google search results list by executing a javascript on the page that would normally resolve when you click the link. Basically, I am trying to resolve all of them when the page loads.</p>
  
  <p>Here is the html generated by google of the first two search results:</p>
  
  <pre><code>&lt;H2 class=hd&gt;Search Results&lt;/H2&gt;
  &lt;DIV id=ires&gt;
  &lt;OL id=rso eid="3gHFUYToG6LD0gGJ2IDAAQ"&gt;
  &lt;LI class=g&gt;
  &lt;DIV class=rc data-hveid="43"&gt;&lt;SPAN style="FLOAT: left"&gt;&lt;/SPAN&gt;
  &lt;H3 class=r&gt;&lt;A onmousedown="return rwt(this,'','','','1','AFQjCNH7JvhrnBRwX-7DKsGJZoasX9zqFA','','0CCwQFjAA','','',event)" href="http://prezi.com/wnx5jat2oene/ipad/"&gt;IPad by &lt;EM&gt;Frunk La Je&lt;/EM&gt; on Prezi&lt;/A&gt;&lt;/H3&gt;
  &lt;DIV class=s&gt;
  &lt;DIV&gt;
  &lt;DIV style="WHITE-SPACE: nowrap" class="f kv"&gt;&lt;CITE&gt;prezi.com/wnx5jat2oene/ipad/&lt;/CITE&gt;‎
  &lt;DIV class="action-menu ab_ctl"&gt;&lt;A aria-haspopup=true aria-expanded=false id=am-b0 class="clickable-dropdown-arrow ab_button" role=button href="#" jsaction="ab.tdd; keydown:ab.hbke; keypress:ab.mskpe" data-ved="0CC0Q7B0wAA" aria-label="Result details"&gt;&lt;SPAN class=mn-dwn-arw&gt;&lt;/SPAN&gt;&lt;/A&gt;
  &lt;DIV class="action-menu-panel ab_dropdown" role=menu tabIndex=-1 jsaction="keydown:ab.hdke; mouseover:ab.hdhne; mouseout:ab.hdhue" data-ved="0CC4QqR8wAA"&gt;
  &lt;UL&gt;
  &lt;LI class="action-menu-item ab_dropdownitem" role=menuitem&gt;&lt;A class=fl onmousedown="return rwt(this,'','','','1','AFQjCNHsvjmPpYAOeqVOHIIs_PWPuD5JaQ','','0CC8QIDAA','','',event)" href="http://webcache.googleusercontent.com/search?q=cache:bKCj-2ogWdIJ:prezi.com/wnx5jat2oene/ipad/+frunk+la+je&amp;amp;cd=1&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;gl=us"&gt;Cached&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;
  &lt;DIV class="f slp"&gt;&lt;/DIV&gt;&lt;SPAN class=st&gt;IPad. No description. by &lt;EM&gt;Frunk La Je&lt;/EM&gt; on 7 June 2012 4 Tweet &lt;B&gt;...&lt;/B&gt; thanks&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;. Make a copy Share Embed Like. by &lt;EM&gt;Frunk La Je&lt;/EM&gt; on 7 June 2012 4.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;
  &lt;LI class=g&gt;
  &lt;DIV class=rc data-hveid="48"&gt;&lt;SPAN style="FLOAT: left"&gt;&lt;/SPAN&gt;
  &lt;H3 class=r&gt;&lt;A onmousedown="return rwt(this,'','','','2','AFQjCNE7-nvy-ymTrBI0x4zleJOUXlY6nA','','0CDEQFjAB','','',event)" href="http://prezi.com/user/q53evqg1dnrn/"&gt;&lt;EM&gt;Frunk La Je&lt;/EM&gt; on Prezi&lt;/A&gt;&lt;/H3&gt;
  &lt;DIV class=s&gt;
  </code></pre>
  
  <p>The function that resolves the first link:</p>
  
  <pre><code>onmousedown="return rwt(this,'','','','1','AFQjCNH7JvhrnBRwX-7DKsGJZoasX9zqFA','','0CCwQFjAA','','',event)"
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>    foreach (HtmlElement h in web.Document.All)
      {
          h.RaiseEvent("onmousedown");
      }
  </code></pre>
  
  <p>I tried replacing "onmousedown" with "MouseDown".</p>
  
  <p>I tried this too:</p>
  
  <pre><code>web.Document.InvokeScript("rwt(this,'','','','1','AFQjCNH7JvhrnBRwX-7DKsGJZoasX9zqFA','','0CCwQFjAA','','',event)");
  </code></pre>
  
  <p>Any ideas how I can get this function to execute? I've also looked at the getElementByID function, but I don't know what the ID is for this.</p>