From: Vasudevan C. <vco...@gm...> - 2014-08-20 19:06:43
|
Hi Ahmed, I am giving you the request details for REAL Browser & HTMLUnit below. REal Browser (First Request) GET /challenge?k=6Lf1-AQAAAAAAL9EskceOVja5Uh5_yo1FRtb1Q83 HTTP/1.1 Host api.recaptcha.net User-Agent Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0 Accept */* Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Referer http://www.patcurtis.com/captcha/recaptcha_demo.php Connection keep-alive Cache-Control max-age=0 WebServer(Response) HTTP/1.1 302 Moved Temporarily Cache-Control no-cache, no-store, max-age=0, must-revalidate Pragma no-cache Expires Fri, 01 Jan 1990 00:00:00 GMT Date Wed, 20 Aug 2014 11:40:18 GMT Location http://www.google.com/recaptcha/api/challenge?k=6Lf1-AQAAAAAAL9EskceOVja5Uh5_yo1FRtb1Q83 Content-Type text/html; charset=UTF-8 Content-Encoding gzip X-Content-Type-Options nosniff X-XSS-Protection 1; mode=block Content-Length 227 Server GSE Alternate-Protocol 80:quic RB(Request) GET /recaptcha/api/challenge?k=6Lf1-AQAAAAAAL9EskceOVja5Uh5_yo1FRtb1Q83 HTTP/1.1 Host www.google.com User-Agent Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0 Accept */* Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Referer http://www.patcurtis.com/captcha/recaptcha_demo.php Cookie PREF=ID=27454a65a243cd70:U=508d4e3f9fa20406:FF=0:LD=en:TM=1406649235:LM=1407436763:GM=1:S=aCHb3CgmGRRcedMi; _ga=GA1.1.1138220839.1407426218; OGP=-4061129:; NID=67=pLb98eXX7XshplSC25O1hUrM6VPe1bG9epaYJREF4EBGoV-TPIQ0MynwuZdb1ra4i_j8jfzeKgHyJRL917tqVvJ1drL2BTn2QE4HaRblzxd0lpITPiswWjYNWO3YMn8g0aV7bw3zFqdW9HrdT3h2iJxykpn7QTCJm7fFHZoSYVRR1zWL_jNpSHvs7u912M5K1skdqY-lGtU; SID=DQAAAMkAAAD1nK0mZZoRhWbUjiHM6nCXAWouJuka0s3NW3l9AO0Tp7vLrszmHqYEeOI2mbDn6Ew2DuOvg0DxTEDPsjQ_-lMPWoXn_8TQYCEpFyvdZUdqdYT1qb2jNjv7cb6192vCkFAjY4LPJo5tKDUvm8_UDsJGrrILWzwGEf9TMkyo8uMP_rZcL3JFbVWfsN7W8j2MZWRLlSoZ-wcpW8PiQc_se5XSVXoZKUdGd67OemZdbEBmX_VRZ66mJln6EtJeJdOWruXp_I72ldDaz9UZMvZJ7ySH; HSID=AbDchAUPI4DtlOcyV; APISID=xLgJV19gOJC9cCD_/ARvW0PuATO71HDPNc Connection keep-alive WebServer(Response) HTTP/1.1 200 OK Cache-Control no-cache, no-store, max-age=0, must-revalidate Pragma no-cache Expires Fri, 01 Jan 1990 00:00:00 GMT Date Wed, 20 Aug 2014 11:39:22 GMT Content-Type text/javascript Content-Encoding gzip X-Content-Type-Options nosniff X-XSS-Protection 1; mode=block Content-Length 7090 Server GSE Alternate-Protocol 80:quic HTMLUnit (First Request) GET /challenge?k=6Lf1-AQAAAAAAL9EskceOVja5Uh5_yo1FRtb1Q83 HTTP/1.1 Host api.recaptcha.net User-Agent Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0 Accept-Language en-US,en;q=0.5 Accept-Encoding gzip, deflate Referer http://www.patcurtis.com/captcha/recaptcha_demo.php Connection keep-alive Accept */* Cache-Control max-age=0 WebServer(Response) HTTP/1.1 302 Moved Temporarily Cache-Control no-cache, no-store, max-age=0, must-revalidate Pragma no-cache Expires Fri, 01 Jan 1990 00:00:00 GMT Date Wed, 20 Aug 2014 18:22:58 GMT Location http://www.google.com/recaptcha/api/challenge?k=6Lf1-AQAAAAAAL9EskceOVja5Uh5_yo1FRtb1Q83 Content-Type text/html; charset=UTF-8 Content-Encoding gzip X-Content-Type-Options nosniff X-XSS-Protection 1; mode=block Content-Length 227 Server GSE Alternate-Protocol 80:quic HTMLUnit(Request) GET /recaptcha/api/challenge?k=6Lf1-AQAAAAAAL9EskceOVja5Uh5_yo1FRtb1Q83 HTTP/1.1 Host www.google.com User-Agent Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0 Accept-Language en-US,en;q=0.5 Cookie NID=67=cA1Qro6B-PbS07zWxNtD3iJ0hHfuc0itJYr1CVnyDCL4PbJNELomp3zFICR6NGdC0C3rQ440_1Y743dl87W5cTtWbAadzMGOZ0-1hbYTqYOSqZrSeN922y0XQr5IcKGE Accept-Encoding gzip, deflate Referer http://www.patcurtis.com/captcha/recaptcha_demo.php Connection keep-alive Accept */* Cache-Control max-age=0 WebServer(Response) HTTP/1.1 200 OK Cache-Control no-cache, no-store, max-age=0, must-revalidate Pragma no-cache Expires Fri, 01 Jan 1990 00:00:00 GMT Date Wed, 20 Aug 2014 18:22:58 GMT Content-Type text/javascript Content-Encoding gzip X-Content-Type-Options nosniff X-XSS-Protection 1; mode=block Content-Length 6994 Server GSE Alternate-Protocol 80:quic ******************************************************************* Kindly Let me know if you need any additional information. Please note that there are many request/response exchanges after the above steps till we get the actual CAPTCHA image Thanks for your help in advance. Regards Vasu On Wed, Aug 20, 2014 at 9:45 PM, Ahmed Ashour <asa...@ya...> wrote: > Hi Vasu, > > Interesting finding. > > A possibility is that HtmlUnit is faster than FF. > > The second thing, as you said, request difference, which you could provide > more details about. > > How about testing with HtmlUnit but with IE/Chrome simluation? > > A remote question: is this case reproducible? > > Ahmed > ------------------------------ > *From:* Vasudevan Comandur <vco...@gm...> > *To:* "htm...@li..." < > htm...@li...> > *Sent:* Wednesday, August 20, 2014 4:38 PM > *Subject:* [Htmlunit-user] HTMLUnit with Recaptcha service of Google > > Hi, > > I am facing a problem connecting to Recaptcha service through HTMLUnit. > > I did the following. > > 1. I used FF browser to connect to Recaptcha service using a demo site > having > the link http://www.patcurtis.com/captcha/recaptcha_demo.php > > 2. Captcha image will get displayed inside the recaptcha widget. > > 3. I was pressing the reload current page continuously after the > captcha image > is displayed. I did not get any error image even after reloading > 500 times. > > I repeated the same exercise through HTMLUnit program. > > I was getting the captcha image for about 200 times of reload. But > after that > recaptcha service was throwing an error image. The link of the error > image is > http://www.gstatic.com/recaptcha/api/img/dos_captcha.jpg. Reloading > after > the error image throws back the same image page. > > Is there any reason for such a different behaviour through HTMLUnit?. I > was > expecting the same behaviour to happen with HTMLUnit as normal browser. > > Does the order of HTTP request headers matter?. I see the order through > charles proxy and see the difference. > > Any pointers to solve this issue would help me. > > Looking forward to your reply. > > Regards > Vasu > > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |