Greetings,

I've been trying to debug why I can't issue a form -> click and finally
started debugging it as a standalone script (as opposed to viewing CGI
output in a browser, duh)

I get the following error msg when I issue the form->click .....

Can't locate object method "epath" via package "URI::http"
 at /usr/local/lib/perl5/site_perl/5.005/HTTP/Cookies.pm

I'm using the same User Agent that I defined earlier in my script that
was
used to pull several pages (including the form I'm trying to submit)
using cookies.
My latest script is attached below.

I saw reference to this problem in the libwww mailing list archives.It
said
to try and "change "epath" to "path" in the Cookie.pm file". Not sure
how
to do this, I use a web hosting service.

Any assistance is appreciated.
Steve Borruso

#!/usr/bin/perl -w
use strict;
$|++;
use URI::URL;
use LWP::Simple ;
use HTML::TokeParser;
use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Request::Common;
use HTML::Form;

my $CustCookieFile = "/mydir/BidVilleCookie.txt";
unlink($CustCookieFile);
my  $ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new(file => "$CustCookieFile", autosave
=> 1));

my  $r = $ua->simple_request(POST "http://www.bidville.com/login.cfm",
                              {
                              # url => '',
                               nickname => 'xxx',
                               password => 'xxx',
                               return => 'http://www.bidville.com',
                              # 'Login!' => 'Login!',
                              });
while ($r->is_redirect) {
   my $u = $r->header('location') or die "missing location: ",
$r->as_string;
   print "redirecting to $u\n";
   $r = $ua->simple_request(GET $u);
}

my $bidville_logo_items = '3279401';
my $BV_Update_item =
'http://www.bidville.com/personal/edit_info.cfm?submit=Edit&itemnum=' .
$bidville_logo_items ;

my $res = $ua->request(HTTP::Request->new(GET => "$BV_Update_item"));
my $html = $res->content;

my $form = HTML::Form->parse($html,'http://www.bidville.com');

print  $form->inputs ;
print  $form->form ;

my $name = 'submit';
my $submit = $form->find_input($name);

my $r2  = $ua->simple_request($submit->click($form));
my $newhtml = $r2->content;

print "heres the new html $newhtml";


Reply via email to