Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Login in to forum with Mechanize

by PerlSufi (Friar)
on Jul 02, 2013 at 21:00 UTC ( [id://1042109]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Login in to forum with Mechanize
in thread Login in to forum with Mechanize

Hi KarlaCluft,
I would try the $mechanize->submit_form(); function.
Some thing like this maybe:
$mech->get($url); $mech->submit_form( form_name => 'signin_form', fields => { 'Username' => $user, 'Password' => $pass} );

If that doesn't work for you, do what runrig said. Also, I recently did a brief tutorial on WWW::Mechanize in our tutorials section if you want to take a look at that.
UPDATE: With your current code, you could also try this instead of just $mech->click();
$mech->click_button( value=> "Login");
If that button is the one needed to submit the user and login and if submit_form doesn't work..

Replies are listed 'Best First'.
Re^4: Login in to forum with Mechanize
by KarlaCluft (Initiate) on Jul 02, 2013 at 22:17 UTC
    but what is the form name?
Re^4: Login in to forum with Mechanize
by KarlaCluft (Initiate) on Jul 02, 2013 at 22:20 UTC
    i can not finde: what is the form name here?
      I was under the impression the form name was 'signin_form' ? I would implement $mech->dump_text; after your code for logging in, too.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1042109]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 03:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found