->submit_form would be the proper way if there was a submit element in the form. This is obviously not the case for your project.

It may be inconvenient, but when automating a website, there is very little to no way around also learning/knowing a bit of HTML and Javascript. The <a class="chase-button ... element is a link, which you have to click after filling out the form. Most likely, that link then triggers some Javascript which collects the values previously filled into that form and sends them to the server.

If the call to ->follow_link(url => ... fails, then most likely, there is no such link. You will have to inspect the HTML closer. At least from the HTML snippet you posted, the link you want to click has no href attribute. It is contained in a <div> element with the class name loginBtn. I would try first clicking on that div, and if that doesn't work, clicking on the link. The <div> can be found by something like:

my $target= $mech->selector('.loginBtn', single => 1 );

The link could be found by something like:

my $target= $mech->selector('.loginBtn a', single => 1 );

In reply to Re^7: Need help logging into my bank with WWW::Mechanize::Firefox by Corion
in thread Need help logging into my bank with WWW::Mechanize::Firefox by johnblack

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.