in reply to Login in to forum with Mechanize

The problem is that the form uses a lot of javascript (for example to turn the password into an md5hash).

You may be able to use WWW::Mechanize::Plugin::JavaScript, but you could also dig through to see what the javascript is doing and do each step yourself within perl code.

Replies are listed 'Best First'.
Re^2: Login in to forum with Mechanize
by Anonymous Monk on Jul 02, 2013 at 20:12 UTC
      how does a login with WWW::Scripter::Plugin::JavaScript work? i can not find any information to that!

        how does a login with WWW::Scripter::Plugin::JavaScript work? i can not find any information to that!

        Look inside (UTSL?)

        OTOH it's not exactly important how it works, only if it works

Re^2: Login in to forum with Mechanize
by KarlaCluft (Initiate) on Jul 02, 2013 at 20:08 UTC
    does that mean, if i would creat a md5 hash from my password myself it would work?

      does that mean, if i would creat a md5 hash from my password myself it would work?

      It might, but that might not be the only thing preventing login -- give it a try

      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..
        but what is the form name?
        i can not finde: what is the form name here?