Yes, thats what I did, the add_handler() is called just before the click_button() call (code below), and I do not see any request or response. There are a bunch of random text that appears though, but it doesn't look like a request and/or response (elaborate log given below)
....
#Logging
$mech->add_handler("request_send", sub { shift->dump; return });
$mech->add_handler("response_done", sub { shift->dump; return });
$mech->click_button(input => $inputobject);
print $mech->status() . "\n";
if ( ! $mech->success() ) {
print "Cannot Login....\n";
print( STDERR $mech->status() . "\n" );
}
.....
Log-
GET https://www.myreports.com/admin/tax_report.php?dc_range=Y&dc_date1
+=7%2F9%2F2012&dc_date2=7%2F9%2F2012
Accept-Encoding: gzip
Referer: https://www.myreports.com/admin/tax_report.php?dc_range=Y&dc_
+date1=7%2F9%2F2012&dc_date2=7%2F9%2F2012
User-Agent: WWW-Mechanize/1.72
Cookie: PHPSESSID=m712pk33kr9ip5ti2be6b8dre3
Cookie2: $Version="1"
(no content)
HTTP/1.1 200 OK
Cache-Control: post-check=0, pre-check=0
Connection: close
Date: Wed, 11 Jul 2012 04:18:42 GMT
Pragma: no-cache
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 555
Content-Type: text/html; charset=iso-8859-1
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Client-Date: Wed, 11 Jul 2012 04:18:43 GMT
Client-Peer: xx.xx.xxx.xxx:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO
+ CA Limited/CN=COMODO High-Assurance Secure Server CA
Client-SSL-Cert-Subject: /C=US/postalCode=75238/ST=Texas/L=Dallas/stre
+et=10300 Sanden Dr Suite 100/O=SpeedFC/OU=PlatinumSSL Wildcard/CN=*.m
+yreports.com
Client-SSL-Cipher: DHE-RSA-AES256-SHA
Client-SSL-Warning: Peer certificate not verified
\37\x8B\10\0\0\0\0\0\0\3\xADTMo\x1A1\20\xBD\xF3+\xA6>\xF4\6\16\x89z\x8
+0\xEE\xAE\x94.\x89\22\x89\xB6\xA8!j{4k\xC3Z\xF5\xDA\xA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xC6?Q\xF5\xEEL'\xCEX\x99\x86\xC7L\xDF\26\xFD\35\xD9\xD7m\x98\xED\
+r\4\x9B\37e\xFE?\xB3<\xFBX\xDC\xFF\x9B\xB4\xDA\xE5\xAC\x92\xB8+O\xE8M
+\xD0f\xF5\x82\xC6W\xDF\x9C\xB3|3\34l\34F*%\xE7~^\xC4;a\5J\xB3\x7F\26\
+xF1\x91\xD0C.\xDFuY(\xC8~\x93m\x87\4\x89\x93\5n\x97j.\x95\xAA\x84os\x
+C8\x99R\x90\xBB\xB5h\xE0\xCET"\xA1\xAC\x9D\6\xD4\xB5\xB7\37\24q@\xB8\
+xDEw\x83,\xEB\xFC\3\x98\27\7\tl\5\0\0
As you said, it looks like the click_button() or any other such method isn't working. One more interesting point is , I just tried the program on my Mac and its not working on it either. I am getting inclined to believe that the WWW::Mechanize module doesn't quite like the Unix/Linux architecture. Also, in my Mac, I am unable to log on to the site from the web browser and it says un-trusted SSL cert security error, but that might be because I do not have the Proxy setting done on the browsers properly. Not entirely sure what is going on here
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.