Hi Monks,

I am trying to write a script that logs into chase.com and grabs account information for two or three accounts automatically. I originally tried WWW::Mechanize but I could not get all the way in because of all the js, cookies etc. that were being thrown back at me.

I was pointed to Mechanize::Firefox which seemed perfect because Firefox already knows how to do all that stuff. I post my code below which I can see is loading up the site and submits the form does not finish. I just end up on a blank page called: https://mfasa.chase.com/auth/login.html. I want the script to go to the home page, fill in the userid and password and submit it and then let firefox do its thing as if I did those things from the browser directly. Any suggestions on what I may be missing are appreciated. Oh, all status' returned are 200.

#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize::Firefox; my $mech = WWW::Mechanize::Firefox->new(); my $url = 'https://www.chase.com/'; sub print_status() { my $status =$mech->status(); print "status = $status\n"; } $mech->get($url, activate => 1, autoclose => 0, js_JSON => 'native'); # Tried this - did not help. print_status(); my $username = 'XXXXXXXX'; my $password = 'XXXXXXXX'; $mech->form_name ('logonform') ; $mech->field (usr_name => $username); $mech->field (usr_password => $password); print_status(); $mech->submit_form(); print_status();

In reply to 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.