in reply to Mechanize login, but redirect. [SOLVED]

The output is success

success just means you requested nicely and the server understood, now read the contents of the response to find out what it says  $mech->dump;

 $derp -> cookie_jar(HTTP::Cookies->new());

redundant, Mech does that already

Replies are listed 'Best First'.
Re^2: Mechanize login, but redirect.
by scarfguy (Novice) on May 16, 2016 at 10:44 UTC

    Now this is Interesting! print $derp -> dump_text(), "\n"; says:

    Note: Since your browser does not support JavaScript, you must press the Continue button once to proceed.

    I have just confirmed with noScript, that this is the Page I never see, when it redirects me. The "Continue Button" is defined as: <input type="submit" value="Continue"></input> This is great! The login works and I just have to click this damn button. Thank you!

    However... I have trouble clicking this button with $derp ->click(name => "Continue". I have also tried it with "submit". Is a button always part of a Form? Do I have to select a Form first?

      I figured it out. If anybody else has this issue. The button doesn't have a name tag, but a value tag. Therefore you can use $derp -> click_button(value => "value-name");

      Thanks everybody. Is there a way to mark this as solved? I'm new to the Forum.

        > Is there a way to mark this as solved?

        Some people edit the original question, adding [Solved] to the title. Some just let it be.

        ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      Mechanizes uses HTML::Form to process forms, which ignores form elements outside of forms

      if that page is using buttons outside of forms, this means javascript is involved, so solution would be as mech faq says, to discover the url using firefox+ livehttpheaders/wireshark or by parsing the javascript in your program

        I don't think javascript is involved. It even says that I have to click the button, because it is not supported. I just don't get why $mech -> click(name => "name") is not finding the button by its Name. But it is a minor issue I guess.