I think WWW::Mechanize automatically follows HTTP redirects, if not, you can subclass WWW::Mechanize to override the redirect_ok() subroutine. Also, since WWW::Mechanize is itself a subclass of LWP::UserAgent, it might help to set max_redirect() to some higher value, and/or set request_redirectable(). see the LWP::UserAgent documentation.

package My::Mech; # My::Mech is a subclass of WWW::Mechanize use base qw(WWW::Mechanize); # always allow redirects, irrespective of # request_redirectable sub redirect_ok { return 1; }

However, your bank's website might use META tags or javascript for "redirects". If so, you have to do the redirection yourself. Depending on the exact format of the page, you could get away with a simple regex, or maybe you need an HTML::Parser to find the redirection URL.


In reply to Re: WWW::Mechanize - Wait until redirected page returned by Joost
in thread WWW::Mechanize - Wait until redirected page returned by zendesign

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.