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

I am unable to login to my torrentz.com account using:

$Torrentz_Interface->submit_form( form_number => 1, fields => { user => $username, pass => $password, } );

They have a unique form:

<form action="/profile" method="post" class="profile"> <fieldset> <legend>User Login</legend> <label for="luser">Username</label> <input name="user" id="luser" class="i" type="text"> <label for="lpass">Password</label> <input name="pass" id="lpass" class="i" type="password"> <div class="s"><input name="go" value="Login" type="submit"></div> </fieldset> </form>

Mech-Dump tells me:

torrentz$ mech-dump http://www.torrentz.com/profile POST http://www.torrentz.com/profile user= (text) pass= (password) go=Login (submit)

I am unsure on how to "go=Login" using submit_form(). I have tried various ways. So I come to you fellow monks, and hope that you can assist me.

Replies are listed 'Best First'.
Re: WWW Mechanize submit_form issue
by Corion (Patriarch) on Aug 14, 2010 at 13:47 UTC

    Of all the various ways you tried, what were they and how did they fail for you?

    Look at the documentation of WWW::Mechanize, especially at the ->click_button() function.

Re: WWW Mechanize submit_form issue
by Gangabass (Vicar) on Aug 15, 2010 at 04:18 UTC
    Try:
    $Torrentz_Interface->submit_form( form_number => 1, fields => { user => $username, pass => $password, }, button => "go" );
    If this does not help -- it may be JavaScript cookies (or cookies which you get downloading some small file: css or image).