Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi all: I could use some help in submitting a form using perl. Here is what the HTML page and my code look like:
<script language="JavaScript"> function submitScreen(actionStr) { document.verify.action.value = actionStr return true; } </script> <tr><td colspan="2" align="center"> <form name="verify" method="post" action="../download/download.asp"> <input type="hidden" name="action" value="abort"> <input type="submit" name="Continue" value="Yes" onClick=submitScreen( +"continue")> <input type="Submit" name="Abort" value="No" ></td> </tr>
Here is what my perl code so far looks like, but I'm not getting the page I want.
use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new(); my $req = POST 'http://companyname.com/Customer/support/Patch/releases +/ClientDownload/download/download.asp', [continue => 'Yes']; #$req->content_type('application/x-www-form-urlencoded'); $req->content('match=www&errors=0&action=abort&continue=Yes'); my $res = $ua->request($req); if ($res->is_success) { print $res->content; if ($res->content =~ m/no software is available/) { print "Did not get desired page\n"; } } else { print "Bad luck this time\n";
If my code was working correctly, the page presented by the server would have a set of links to files available for downloading. My intent is to monitor this page and start a download followed by an automated install of the software, followed by an invocation of my automated tests. AdThanksVance

In reply to Submitting a form by muradkhan

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (6)
    As of 2021-04-15 16:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?