WWW::Mechanize click() returns "Unexpected field value"

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default WWW::Mechanize click() returns "Unexpected field value"

    A friend of mine wrote a Perl script that works fine on his machine
    but dies on mine. I know very little about Perl, so I need help in
    determining the problem. Here's the code that fails:

    my $agent = WWW::Mechanize->new();
    $agent->get("http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm");
    die "Couldn't get login screen" unless $agent->success;
    my $id = "userid";
    $agent->field("newUsername",$id);
    my $password = "password";
    $agent->field("newPassword",$password);
    $agent->click();

    When it tries to execute the click() call, it generates this message:

    Unexpected field value
    [url]http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm[/url] at (eval 15) line
    1

    I added the line "use Carp 'verbose';" to the Perl module, and now I
    get this:

    Unexpected field value
    [url]http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm[/url] at
    /usr/lib/perl5/vendor_perl/5.6.1/HTTP/Headers.pm line 256
    HTTP::Headers::_header('HTTP::Headers=HASH(0x846bd 44)',
    'Referer', 'http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm')
    called at /usr/lib/perl5/vendor_perl/5.6.1/HTTP/Headers.pm line 150
    HTTP::Headers::header('HTTP::Headers=HASH(0x846bd4 4)') called
    at (eval 15) line 1
    HTTP::Message::__ANON__('HTTP::Request=HASH(0x846b ce4)',
    'Referer', 'http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm')
    called at /usr/lib/perl5/site_perl/5.6.1/WWW/Mechanize.pm line 1045
    WWW::Mechanize::request('WWW::Mechanize=HASH(0x818 1abc)',
    'HTTP::Request=HASH(0x846bce4)') called at
    /usr/lib/perl5/site_perl/5.6.1/WWW/Mechanize.pm line 515
    WWW::Mechanize::click('WWW::Mechanize=HASH(0x8181a bc)') called
    at ./reserve.pl line 30

    Can anyone tell me what's going on? I'm running Perl 5.6.1 on Red Hat
    Linux 7.3.
    Timur Tabi Guest

  2. Similar Questions and Discussions

    1. "Page" and "Rect" props of the Field prop in Javascript API
      Page property of the Field property in Javascript Acrobat API returns an array of pages that this field exists in. On the other hand, "rect" property...
    2. "make Makefile.PL" returns "...up to date"; make returns "no target to make"
      I'm attempting to install a perl module (AppConfig-1.56) on a FreeBSD 4.9 system. It has both perl 5.5.3 and 5.8.3 and several modules are already...
    3. #26292 [Opn->Bgs]: substr returns "0" for any offset on the string "0"
      ID: 26292 Updated by: sniper@php.net Reported By: ravacholp at hotmail dot com -Status: Open +Status: ...
    4. Compare 2 fields & delete everything in "field 2" that occurs in "field 1"
      Is it possible to compare 2 fields and delete everything in "field 2" that also occurs in "field 1" ? FIELD1 800-555-1212 for...
    5. dr("field").toString returns "400.0000" instead of "400"
      I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to...
  3. #2

    Default WWW::Mechanize click() returns "Unexpected field value"

    A friend of mine wrote a Perl script that works fine on his machine
    but dies on mine. I know very little about Perl, so I need help in
    determining the problem. Here's the code that fails:

    my $agent = WWW::Mechanize->new();
    $agent->get("http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm");
    die "Couldn't get login screen" unless $agent->success;
    my $id = "userid";
    $agent->field("newUsername",$id);
    my $password = "password";
    $agent->field("newPassword",$password);
    $agent->click();

    When it tries to execute the click() call, it generates this message:

    Unexpected field value
    [url]http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm[/url] at (eval 15) line
    1

    I added the line "use Carp 'verbose';" to the Perl module, and now I
    get this:

    Unexpected field value
    [url]http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm[/url] at
    /usr/lib/perl5/vendor_perl/5.6.1/HTTP/Headers.pm line 256
    HTTP::Headers::_header('HTTP::Headers=HASH(0x846bd 44)',
    'Referer', 'http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm')
    called at /usr/lib/perl5/vendor_perl/5.6.1/HTTP/Headers.pm line 150
    HTTP::Headers::header('HTTP::Headers=HASH(0x846bd4 4)') called
    at (eval 15) line 1
    HTTP::Message::__ANON__('HTTP::Request=HASH(0x846b ce4)',
    'Referer', 'http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm')
    called at /usr/lib/perl5/site_perl/5.6.1/WWW/Mechanize.pm line 1045
    WWW::Mechanize::request('WWW::Mechanize=HASH(0x818 1abc)',
    'HTTP::Request=HASH(0x846bce4)') called at
    /usr/lib/perl5/site_perl/5.6.1/WWW/Mechanize.pm line 515
    WWW::Mechanize::click('WWW::Mechanize=HASH(0x8181a bc)') called
    at ./reserve.pl line 30

    Can anyone tell me what's going on? I'm running Perl 5.6.1 on Red Hat
    Linux 7.3.
    Timur Tabi Guest

  4. #3

    Default Re: WWW::Mechanize click() returns "Unexpected field value"

    Timur Tabi <nospam_timur@tabi.org> wrote:
    > A friend of mine wrote a Perl script that works fine on his machine
    > but dies on mine. I know very little about Perl, so I need help in
    > determining the problem. Here's the code that fails:

    Are you going to post this same question every 3 days?


    [url]http://www.plover.com/~mjd/perl/Questions.html[/url]


    --
    Tad McClellan SGML consulting
    [email]tadmc@augustmail.com[/email] Perl programming
    Fort Worth, Texas
    Tad McClellan Guest

  5. #4

    Default Re: WWW::Mechanize click() returns "Unexpected field value"

    Timur Tabi <nospam_timur@tabi.org> wrote:
    > A friend of mine wrote a Perl script

    Then he probably knows a bit of Perl.

    > that works fine on his machine
    > but dies on mine. I know very little about Perl, so I need help in
    > determining the problem.

    What did your Perl friend say when you asked him about it?


    --
    Tad McClellan SGML consulting
    [email]tadmc@augustmail.com[/email] Perl programming
    Fort Worth, Texas
    Tad McClellan Guest

  6. #5

    Default Re: WWW::Mechanize click() returns "Unexpected field value"

    [email]tadmc@augustmail.com[/email] (Tad McClellan) wrote in message news:<slrnbmgtp6.7o0.tadmc@magna.augustmail.com>.. .
    > What did your Perl friend say when you asked him about it?
    He said that it works for him and he has no idea why it doesn't work
    for me. He also could not tell me how to debug it.
    Timur Tabi Guest

  7. #6

    Default Re: WWW::Mechanize click() returns "Unexpected field value"

    [email]tadmc@augustmail.com[/email] (Tad McClellan) wrote in message news:<slrnbmgtmi.7o0.tadmc@magna.augustmail.com>.. .
    > Are you going to post this same question every 3 days?
    >
    > [url]http://www.plover.com/~mjd/perl/Questions.html[/url]
    I read that web page, and I don't think any of those "reasons" apply
    to my re-post. I believe the reason why my post was ignored was
    because almost no one read it. It was posted late at night, and by
    the next morning, there were so many other posts that mine was
    "crowded out".

    I think I put quite a bit of detail in my post, and it should be
    obvious that I'm not a lazy individual who wants someone else to do
    all the work for me. I'm willing to debug the problem myself, but I
    don't know how.
    Timur Tabi Guest

  8. #7

    Default Re: WWW::Mechanize click() returns "Unexpected field value"

    >>>>> "Timur" == Timur Tabi <nospam_timur@tabi.org> writes:

    Timur> I read that web page, and I don't think any of those "reasons" apply
    Timur> to my re-post. I believe the reason why my post was ignored was
    Timur> because almost no one read it. It was posted late at night,

    Who's "night"? There are people here that are reading 24x7, in nearly
    every timezone.

    Timur> and by
    Timur> the next morning, there were so many other posts that mine was
    Timur> "crowded out".

    Ahh, you've made the "help desk" mistake. This is not a help desk.
    People will answer interesting questions, discuss others, and ignore
    others. It's not up to you to decide someone else's response
    schedule, and reposting a question only irritates the locals.

    print "Just another Perl hacker,"

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Randal L. Schwartz Guest

  9. #8

    Default Re: WWW::Mechanize click() returns "Unexpected field value"

    [email]nospam_timur@tabi.org[/email] (Timur Tabi) wrote in message news:<53bb806a.0309171351.44b4ee42@posting.google. com>...
    > [email]tadmc@augustmail.com[/email] (Tad McClellan) wrote in message news:<slrnbmgtp6.7o0.tadmc@magna.augustmail.com>.. .
    >
    > > What did your Perl friend say when you asked him about it?
    >
    > He said that it works for him and he has no idea why it doesn't work
    > for me. He also could not tell me how to debug it.
    So your problem is that you're trying to run a perl script which was
    written by someone who does't know how to debug it and has no idea why
    it doesn't work.

    mmmm.
    Chris Marshall Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139