Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Here is my updated code:

#!/usr/bin/perl -w use strict; use WWW::Mechanize; my $response = ""; my $m = WWW::Mechanize->new(); $m->agent_alias('Linux Mozilla'); #$m->get(''); $m->get(' +cid=40'); printf("%s\n", $m->title()); $m->dump_forms(); $response = $m->submit_form( form_number => 1, fields => { 'cid_40$txtUsername' => '<username>', 'cid_40$txtPassword' => '<password>', } ); die unless ($m->success); printf("response code is %s\n", $response->code); printf("response message is %s\n", $response->message); printf("response content is %s\n", $response->content); printf("response header time is %s\n", $response->header('date'));

The above should be correctly parsing the response from the command. The only problem is that the response doesn't seem to indicate what is going on:

response code is 200 response message is OK response content is (tons of binary data) response header time is Wed, 13 Mar 2013 03:36:18 GMT

I can't figure out from the above what is going on. Does anyone have any hints/tips? Note that I get the above response even if I enter a deliberately incorrect username and/or password.

In reply to Re^2: form not being filled out by WWW::Mechanize by Special_K
in thread form not being filled out by WWW::Mechanize by Special_K

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?

    What's my password?
    Create A New User
    and the monks are chillaxin'...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (6)
    As of 2018-06-20 13:49 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (116 votes). Check out past polls.