From: Rural H. <rur...@gm...> - 2017-06-26 09:15:26
|
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body text="#000000" bgcolor="#FFFFFF"> <div class="moz-cite-prefix">Hi Guillaume,<br> <br> You'd better wait for some time after the click by WebClient.waitXXXXXX, especially for those scripts with ajax calls.<br> <br> 在 2017/6/26 16:59, Guillaume Lepinay 写道:<br> </div> <blockquote type="cite" cite="mid:CAJLCd59WswgcQ27kn1Zd51vZ4ZCELp+Q42K0m04_RANqLh=Yd...@ma..."> <div dir="ltr"> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">Hello every body,</font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444"><br> </font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">I have a link like this : </font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(51,51,255)"><br> </div> <div class="gmail_default"> <div class="gmail_default"><font face="monospace, monospace" color="#000000"><b><a tabindex="2" href=<a class="moz-txt-link-rfc2396E" href="javascript:raf()">"javascript:raf()"</a>></b></font></div> <div class="gmail_default"><font face="monospace, monospace" color="#000000"><b>&nbsp;&nbsp;0&nbsp;&nbsp;</b></font></div> <div class="gmail_default"><font face="monospace, monospace" color="#000000"><b></a></b></font></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><br> </div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">I can find it with HtmlUnit and I use the click() method to execute the javascript (method raf() in this example).</font></div> <div class="gmail_default" style="font-family:tahoma,sans-serif"><font color="#444444">But nothing happens.</font></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><br> </div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">The script doesn't run any ajax request. It only changes the value of another field.</span><br> </div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">But after clicking, when I get the value of the input that should have changed, it is still the same.</span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)"><br> </span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">Is there something special to click this kind of link ?</span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)"><br> </span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">Thank you for your help.</span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)"><br> </span></div> <div class="gmail_default" style="color:rgb(51,51,255);font-family:tahoma,sans-serif"><span style="color:rgb(68,68,68)">i'm using HtmlUnit 2.23. With the 2.27 and 2.28 SNAPSHOT I get an error due to illegal character inside the javascript pages.</span></div> </div> </div> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! <a class="moz-txt-link-freetext" href="http://sdm.link/slashdot">http://sdm.link/slashdot</a></pre> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ Htmlunit-user mailing list <a class="moz-txt-link-abbreviated" href="mailto:Htm...@li...">Htm...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/htmlunit-user">https://lists.sourceforge.net/lists/listinfo/htmlunit-user</a> </pre> </blockquote> <p><br> </p> </body> </html> |