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

  • Follow


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
http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm at (eval 15) line
1

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

Unexpected field value
http://w3.reserve.ibm.com/Reserve/ReserveLogon-3.htm at
/usr/lib/perl5/vendor_perl/5.6.1/HTTP/Headers.pm line 256
        HTTP::Headers::_header('HTTP::Headers=HASH(0x846bd44)',
'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(0x846bd44)') called
at (eval 15) line 1
        HTTP::Message::__ANON__('HTTP::Request=HASH(0x846bce4)',
'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(0x8181abc)',
'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(0x8181abc)') 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.
0
Reply nospam_timur (23) 9/17/2003 1:50:51 PM

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?


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


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas
0
Reply tadmc 9/17/2003 2:59:30 PM


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
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas
0
Reply tadmc 9/17/2003 3:00:54 PM

tadmc@augustmail.com (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.
0
Reply nospam_timur 9/17/2003 9:51:52 PM

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbmgtmi.7o0.tadmc@magna.augustmail.com>...

> Are you going to post this same question every 3 days?
> 
>       http://www.plover.com/~mjd/perl/Questions.html

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.
0
Reply nospam_timur 9/17/2003 9:54:59 PM

>>>>> "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!
0
Reply merlyn 9/18/2003 4:16:50 PM

nospam_timur@tabi.org (Timur Tabi) wrote in message news:<53bb806a.0309171351.44b4ee42@posting.google.com>...
> tadmc@augustmail.com (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.
0
Reply c_j_marshall 9/19/2003 11:23:41 AM

6 Replies
39 Views

(page loaded in 0.14 seconds)

Similiar Articles:





7/21/2012 9:51:02 PM


Reply: