Hi there,

Can someone explain what I'm doing wrong here? 

Trying to set a cookie at a site (alltheweb.com) before
filling in a form. All works without the cookie, but with 
the cookie I get the error:

ted:~/perl/SiteSpider ->./test.pl
Can't locate object method "epath" via package "URI::http" at
/usr/local/lib/perl5/site_perl/5.6.0/HTTP/Cookies.pm line 110.

The cookie itself is the created by going to the site, letting
it set the cookie, and then copying it from the .netscape/cookies
file. Any ideas?

Thanks for any help.

#!/usr/local/bin/perl -w

use strict;

use HTML::Form;
use HTML::TokeParser;
use LWP::UserAgent;
use HTTP::Cookies;
use URI;

my @words = qw/perl python ruby java/;

my $frontpage = "http://www.alltheweb.com/";;

my $ua = LWP::UserAgent->new;
my $jar = HTTP::Cookies::Netscape->new(
              File => "alltheweb.cookie",
              AutoSave => 1,
          );

$ua->cookie_jar($jar);

my $response = $ua->request(HTTP::Request->new('GET', $frontpage));
my $form = HTML::Form->parse($response->content, $frontpage);

# Search using alltheweb.com
foreach (@words) {
    $form->value(query => $_);

    # This line results in an error!
    my $resp = $ua->request($form->click);
}

__END__

-- 
Dr Stefan Kruger <[EMAIL PROTECTED]> http://www.inty.net
Developer, Intelligent Network Technology Ltd
1700 Park Avenue, Aztec West, Bristol BS32 4UA, UK

Reply via email to