in reply to Re^2: Need help logging into my bank with WWW::Mechanize::Firefox
in thread Need help logging into my bank with WWW::Mechanize::Firefox

I feel like I'm close. If I exit my script before the call to submit_form(), it has the page called up and has filled in the userid and pwd. If I then manually click the green button that says Log In To Accounts, I get in.

But I can't figure out how to do that from within Mechanize::Firefox. If I go by button number, I am told there is only one button on the page. If I click that one, I find out that it is the search button. So if that log in button is not a "button", what is it and how can I click it? Thanks.

  • Comment on Re^3: Need help logging into my bank with WWW::Mechanize::Firefox

Replies are listed 'Best First'.
Re^4: Need help logging into my bank with WWW::Mechanize::Firefox
by Corion (Patriarch) on Dec 09, 2014 at 16:37 UTC

    Have you looked at the HTML of the page, and/or used the "Object Inspector" (Ctrl-Shift-I) to find out what the element on the page is that looks like a submit button?

Re^4: Need help logging into my bank with WWW::Mechanize::Firefox
by johnblack (Initiate) on Dec 09, 2014 at 16:59 UTC

    Here is the code for the button I am trying to click.

    <div class="field initialized loginBtn"> <div class="chase-button-container" style="top:0px; left:0px"> <div class="inner-large"> <a class="chase-button primary-button large-button" data-h +orizontalpos="-46" data-pt-name="knwnlogin" data-verticalpos="0" data +-accessible-text="" data-multiselect="false" data-background="none" d +ata-decoration="lock" data-size="large" data-type="primary-button" hr +ef="#" role="button"></a> </div> </div> </div>

      That's not a button, it's a plain link styled to appear like a button.

      You will have to ->click on that link after filling out the form.

        Thanks Corion, but I still don't know how to do it. I don't see a link there that I can recognize but I don't know web code. I see a nearby link and tried this after filling out the form:

        $mech->follow_link(url => 'https://mfasa.chase.com/auth/login.html' );

        But that gave an error: No link found matching '//a[(@href = "https://mfasa.chase.com/auth/login.html...

        I see you said use 'click' but my understanding of click is that it is for buttons and so I would need a button name or number but its not a button you say

        And one more question if I may, why was submit_form() not the appropriate call after filling out the form? Thanks.