hello monks I am having an issue filling out a form with valid information. Here is my code:
#! /usr/bin/perl use Web::Scraper; use WWW::Mechanize; use WWW::Mechanize::FormFiller; use LWP::UserAgent; #This block of code follows from the CAPS homepage to the Account Inqu +iries link my $mech = WWW::Mechanize->new(); my $url = "http://caps.usps.gov/capshome.asp"; $mech->get($url); $mech->follow_link( url => 'https://caps.usps.gov/ssl_caps/caps_ai +.asp'); if ($mech->success()){ print "Successful Connection\n"; } else { print "Not a successful connection\n"; } #enter start and end date print "Enter Start date in the form of MMDDYY:\n"; my $start_date = <STDIN>; chomp; print "Please Enter an end date in the form of MMDDYY:\n"; my $end_date = <STDIN>; chomp; #This block of code is intended to fill in the required forms $mech->get("https://caps.usps.gov/ssl_caps/caps_ai.asp"); my $usr = "11111"; #not valid id for security purposes my $pw = "1111"; #not valid pw for security $mech->form_number(1); $mech->field( "capsn", $usr); $mech->form_number(2); $mech->field("capsp", $pw); $mech->form_number(3); $mech->field( "startdate", $start_date); $mech->form_number(4); $mech->field( "enddate", $end_date); $mech->click(); #print the content (for debugging) print $mech->content;
The message I get with the displayed content is that I did not enter a valid starting date, but I have. Any help is greatly appreciated! Love, PerlSufi

In reply to perl form filling by PerlSufi

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.