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.


In reply to Re^2: WWW::Mechanize click_button() not working in AIX by perl_monster
in thread WWW::Mechanize click_button() not working in AIX by perl_monster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.