#!/usr/bin/perl -- use strict; use warnings; use WWW::Mechanize; my @date = ( 18960101, "18960101\n", ); foreach my $date (@date) { my $mech = WWW::Mechanize->new(); $mech->agent_alias('Windows IE 6'); $mech->get("http://bub2.meteo.psu.edu/wxstn/wxstn.htm"); $mech->form_number(1); $mech->field( 'dtg', $date ); eval { $mech->click(); 1 } or print "$@\n", $mech->response->content, "\n"; print "-=> date => [$date] => ", $mech->status, "\n"; # my $file = "c:/perl/scripts/dates/$date.txt"; # $mech->save_content($file); $mech->back(); } __END__ -=> date => [18960101] => 200 Error POSTing http://bub2.met.psu.edu/cgi-win/WXDaily.EXE: Internal Er +ror at 2 line 14 <HTML><HEAD> <TITLE>Error in /cgi-win/WXDaily.EXE</TITLE> </HEAD><BODY> <H1>Error in /cgi-win/WXDaily.EXE</H1> An internal Visual Basic error has occurred in /cgi-win/WXDaily.EXE. <PRE>Bad file name or number (error #52)</PRE> <I>Please</I> note what you were doing when this problem occurred, so we can identify and correct it. Write down the Web page you were us +ing, any data you may have entered into a form or search box, and anything else that may help us duplicate the problem. Then contact the administrator of this service: <A HREF="mailto:wjs1@psu.edu"> <ADDRESS>&lt;wjs1@psu.edu&gt;</ADDRESS> </A></BODY></HTML> -=> date => [18960101 ] => 500

In reply to Re^5: WWW::Mechanize - can't submit each value in an array by Anonymous Monk
in thread WWW::Mechanize - can't submit each value in an array by cheech

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.