From: Ahmed A. <asa...@ya...> - 2015-06-25 21:10:08
|
Hi Vasu, That's great. You can use HtmlImage.saveAs() or .getImageReader() Ahmed From: Vasudevan Comandur <vco...@gm...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Thursday, June 25, 2015 6:54 PM Subject: Re: [Htmlunit-user] HTMLUnit does not seem to execute the Javascript HI Ahmed, Upon further analysis, it was determined that JS was executing the src in img tag. The javascript was executing an <img> tag. Since HTMLUnit does not download the image tag, the URL was not getting executed. How do I make the webclient execute the img tag?. Is there any option to be enabled in Webclient? Looking forward to your reply Regards Vasu Kindly let me know how to enable that? On 25 June 2015 at 02:01, Ahmed Ashour <asa...@ya...> wrote: Hi Vasu, You need to debug the JavaScript for captch, which is long and is minified. The first step is to have the all the files locally into a web server. Then you can 'beautify' the JavaScript with any online tool. Then you add alert() in various places, and see which was triggered by real browser, and which isn't by HtmlUnit. Hope that helps,Ahmed From: Vasudevan Comandur <vco...@gm...> To: Ahmed Ashour <asa...@ya...>; "htm...@li..." <htm...@li...> Sent: Wednesday, June 24, 2015 8:08 PM Subject: Re: [Htmlunit-user] HTMLUnit does not seem to execute the Javascript Hi Ahmed, I was tracing the execution of HTMLUnit version 2.15 as part of the Google Recaptcha Widget download which happens through JS and image display using the demo URL http://www.patcurtis.com/captcha/recaptcha_demo.php site. I added few print statements in HtmlScript.java file inside executeScriptIfNeeded and setAttributeNS methods. I did not see any download of image files which are there as part of the widget since HTMLUnit does not download the image files by default. SetAttributeNS method treats the below URL generated as part JS execution as type=text/javascript. src = http://www.google.com/recaptcha/api/reload?c=03AHJ_VuvmwTN2LxSz8J7dtNZX81A l0QFvt2JyKcpqXcCP6Ebhbs1iwjCwTj3mxGkjAoc-nv-JljJtbSblYrhKA3zK9lhsC4GWpyGJvVWuJ-dT7N28xReMFBWpNG5qmRAQkTdAUIiUPESqA56HaP4QvIp7pLj5q7R dI-GsTBZNl4wTbb0CE4nS4H2QNkXJk69K22y7XGoZoplGnVqZo3-eCceM0vNuNZC4ag&k=6Lf1-AQAAAAAAL9EskceOVja5Uh5_yo1FRtb1Q83&reason=i&type=image&l ang=en-GB&th=,coOwiE56XYH9N2a2lyztIOsFl5bwAAACoKAAAABu2AC0rMWOid-5CTrmKC6e3ami38LUaxj93ocIgqGTY9RGp7USlJXefyMwL0PSDWZB8F-jfGsT3SYmtI -bcmXTBjwgs6KUmyzE_KPa_Oy4p6XOmGR1rCGzxC1_qTKf960khqvhaYs3YR2X2RIFC1fWREKGDa2UFrJXeUcK0B8ZmaPuCM4ApSWV7FEHSlbM4u3AkfT5JlCPADOI_jtV2Z GozH4Z-bSuwjQG048s9Z7di_Jq03cvf7lP The response data is given below which was captured inside loadJavascriptfromURL Inside loadJavaScriptFromUrl Method in HTMLPage.java file...Recaptcha.finish_reload('03AHJ_VuvsYkou1euMxszLTJzD0IQCRKynnIGDBJckG-APe XiFr8ncPLZK7kS1rhIY_YT4triXHvkIlMwSDtTYsYw32_ntpqnarqJS_JAS0CICMFwB6AIy-pN3rNZRsDn2CJUSvUfscaW6WDAw1SlAzyV82rMSgvf6ijr_8y_MTWR6qA7N0 iHYTVsHATqbPVIkiUzMppmamHuHp5YL-UvmupP9Hzk92P55Ww', 'image', null, null); Finish_reload is a method which is inside recaptcha.js file which was download in the beginning that takes four arguments. I saw the executeEventIfBrowserHasFeature method was called with EVENT_ONLOAD_EXTERNAL_JAVASCRIPT params. But the finish_reload method was NOT getting executed. It would be great if someone helps me to figure out the reason. Looking forward to a reply. Regards Vasu ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |