Hello Monks,

I'm having some trouble working with forms in HTML. My project is to automate login to certain web pages and download information from them. I have done this successfully for one website. However, two other sites are giving me problems. Here is some sample code:

$login_url = url 'https://webbroker1.tdwaterhouse.com/TD/Waterhouse/ie +4x/logonForm.asp'; $ua = LWP::UserAgent->new; my $login_req = GET $login_url; my $login_res = $ua->request($login_req); my $tb = HTML::TreeBuilder->new; $tb->parse($login_res->content); my @forms = @{$tb->extract_links(qw(FORM))}; my $f = HTTP::Request::Form->new($forms[0][1], $login_url); $f->dump;

If you visit the website given, you will see a login page where you type your Account Number and Password to gain access to the site. However, in the form that is downloaded (printed to STDIO with the dump command), the only fields that show up are a bunch of hidden fields, not the "UserID" and "Password", which are the two fields I need to fill out. I am aware of how to handle multiple forms per page, and this page contains only one form. This exact same code worked fine on another website (https://login.fidelity.com/ftgw/Fidelity/RtlCust/Login/Init) but on this one it does not work. Thank you very much for your help!

-Patrick

In reply to trouble filling out HTML form by diablo1024

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.