Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am having problem getting WWW::Mechanize to work on a button. This button has no name, which is my problem I am guessing.

The code for it is

<input type="submit" value="Add to Friends">
And I tried
# the get link exists, but excluded in the sample $mech->submit_form( form_name => 'addFriend', submit => 'Add To Friends' );
But it resulted in "no clickable button..". The form name is right and there are 2 buttons on this form. There's this one that I NEED to click, and another one (code below) that I need to ignore
<input type="button" value="Cancel" onclic +k="window.history.back()">
Can someone please help me with this one?

Replies are listed 'Best First'.
Re: WWW::Mechanize problem with button
by hesco (Deacon) on Jun 03, 2006 at 18:06 UTC
    Try: perl -MWWW::Mechanize::Shell -e"shell"

    after install and reading the perldoc for WWW::Mechanize::Shell and use the shell to navigate the form, inspect its structure and find a way of submitting that button.

    get URL forms form FORMNAME click NAME or click "" script (to obtain the results in an executable form for importation into your script)
    -- Hugh

    if( $lal && $lol ) { $life++; }