Saturday 15 May 2010

c# - Execute javascript in webbrowser control -


I am trying to resolve the link in a Google search result list by executing a JavaScript on that page which is usually When you click on the link you will solve. Basically, I'm trying to solve all of the pages while loading.

Here is the Google-generated HTML of the first two search results:

   & Lt; Div id = ires & gt; & Lt; OL id = rso eid = "3gHFUYToG6LD0gGJ2IDAAQ" & gt; & Lt; LI square = G & gt; & Lt; Div class = rc data-haed = "43" & gt; & Gt; Span style = "float: left" & gt; & Lt; / SPAN & gt; & Lt; H3 square = R & gt; & Lt; An onmousedown = "return RWT (this, '', '', '', '1', 'AFQjCNH7JvhrnBRwX-7DKsGJZoasX9zqFA', '', '0CCwQFjAA', '', '', event)" href = "http: /prezi.com/wnx5jat2oene/ipad/ "& gt; By IAD & lt; EM & gt; Frank La J. L. L. / EM & gt; PRESEX & lt; / A & gt; & Lt; / H3> & Lt; DIV square = s & gt; & Lt; Div & gt; & Lt; DIV style = "white-space: aboper" class = "FKV" & gt; & Lt; CIT & gt; Preci / Monx 5 Jet 2 Oeni / Appad / Lt; / Seat & gt; One ???? & Lt; Div class = "action-menu ab_ctl" & gt; & Lt; A aria-haspopup = true aria-extension = false id = am- B0 square = "clickable-drop-down ab_button" role = button href = "#" jsaction = "ab.tdd; keydown: ab.hbke; key Pressing: ab.mskpe "Data-Ved =" 0CC0Q7B0wAA "aria-label =" Results Details "& gt; & Lt; Span class = mn-dwn arw & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; Div class = role = menu tabindex = -1 jsaction = "ab_dropdown action menu panel" "keydown:; ab.hdhne; mouseout: mouseover ab.hdke ab.hdhue" data-ved = "0cc4QqR8wAA" & gt; & Lt; UL & gt; & Lt; Li class = "action-MENUITEM ab_dropdownitem" role = MENUITEM & gt; & Lt; "Class = //webcache.googleusercontent.com/search?q=cache:bKCj-2ogWdIJ:prezi.com/wnx5jat2oene/ipad/+frunk+la+jie & cd = 1 & amp; hl = h & amp; Amp; CT = clnk & 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 slip" & gt; & Lt; / DIV & gt; & Lt; Span class = seat & gt; IPad no details. By & lt; EM & gt; Frank La J. L. L. / EM & gt; On June 7, 2012, 4 tweet & lt; B & gt; ... & lt; / B & gt; Thanks & amp; Lt; / A & amp; Gt; & Amp; Lt; / P & amp; Gt; Share a copy by & lt; EM & gt; Frank La J. L. L. / EM & gt; On June 7, 2012, 4. & lt; / SPAN & gt; & Lt; / DIV & gt; & Lt; / DIV & gt; & Lt; / DIV & gt; & Lt; / LI & gt; & Lt; LI square = G & gt; & Lt; Div class = rc data-hvid = "48" & gt; Spine style = "float: left" & gt; & Lt; / SPAN & gt; & Lt; H3 square = R & gt; & Lt; An onmousedown = "return RWT (this, '', '', '', '2', 'AFQjCNE7-nvy-ymTrBI0x4zleJOUXlY6nA', '', '0CDEQFjAB', '', '', event)" href = "http : //prezi.com/user/q53evqg1dnrn/ "& gt; & Lt; EM & gt; Frank La J. L. L. / EM & gt; PRESEX & lt; / A & gt; & Lt; / H3> & Lt; DIV square = s & gt;   

function that fixes the first link:

  onmousedown = "return rwt (this, '', '', '', '1' 'AFQjCNH7JvhrnBRwX-7DKsGJZoasX9zqFA', '', '0CCwQFjAA', '', '', event) "  

I tried this:

  foreach HtmlElement H in web.Document.All) {h.RaiseEvent ("onmousedown"); }   

I tried to change "onsmooth" with "mousedown".

I also tried:

  web.Document.InvokeScript ("RWT (", "", "", "1", "AFQjCNH7JvhrnBRwX- 7DKsGJZoasX9zqFA ',' ',' 0CCwQFjAA ',' ',' ', incident) ");   

Any ideas how can I execute this function? I have also seen the getElementByID function, but I do not know what the ID is for this matter.

<> P> One Click Emulation Try to tell that the program's one of your anchor tags & lt. Now using our own code, we will simulate a click on our first anchor tag which is subscript 0 (shown below), like this:
  html element simulate click analytics = web browser 1 Document. Get Elements Biatagnam ("A") [0]; SimulateClickAnchor.InvokeMember ("click on");    

No comments:

Post a Comment