in reply to Re: WWW::Mechanize click_button() not working in AIX
in thread WWW::Mechanize click_button() not working in AIX

Unfortunately, the only way I can target the button is to use the key/value pair I have used in the code. The HTML is a bit odd, but it belongs to a third party and I have little control over it. It looks like below (posting just the body portion of it which includes the logon form)-

<body> <h1>Account &nbsp;--&nbsp; Log In</h1> <div id="content"> <form method="post"> <table id="login" cellpadding="0" cellspacing="0"> <tr> <th colspan="2" class="right">Log In</th> </tr> <tr> <td class="label">Username:</td> <td class="right"> <input type="text" name="login" value="" size="15" +/> </td> </tr> <tr> <td class="label">Password:</td> <td class="right"> <input type="password" name="passwd" size="15"/> </td> </tr> <tr> <th colspan="2" class="last"> <input type="submit" value="Login now"/> </th> </tr> </table> <input type="hidden" name="action" value="login"/> </form> <a href="/">Speed Fulfillment & Call Center Home</a> </div> </body>

as you can see that the button is actually a form submit element. So having said this, i have also tried $mech->submit() , but it did not work either.

Replies are listed 'Best First'.
Re^3: WWW::Mechanize click_button() not working in AIX
by onelesd (Pilgrim) on Jul 10, 2012 at 21:01 UTC
    Have you compared the perl/module versions like Corion suggested?

      The WWW::Mechanize version in both the machines is 1.54 (latest) they were installed on the same day on the Win machine and AIX machine. The Perl version in Win machine is 5.10.1 and AIX version of perl is 5.8.8, I am not sure if that should make any difference. Also, I am thinking if this is problem due to "Https". I am wondering if I need Net::SSLeay.

        LWP::UserAgent which WWW::Mechanize inherits from takes care of SSL for you.

        Have you tried $mech->find_all_submits( ... criteria ... ) and debugging that to make sure the button is recognized?