develooper Front page | perl.libwww | Postings from September 2001

Cookie problems.

Thread Next
Stefan Kruger
September 10, 2001 10:19
Cookie problems.
Message ID:
Hi there,

Can someone explain what I'm doing wrong here? 

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

ted:~/perl/SiteSpider ->./
Can't locate object method "epath" via package "URI::http" at
/usr/local/lib/perl5/site_perl/5.6.0/HTTP/ 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 = "";

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


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

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

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


Dr Stefan Kruger <>
Developer, Intelligent Network Technology Ltd
1700 Park Avenue, Aztec West, Bristol BS32 4UA, UK

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About