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

Help please !! ASAP !

From:
Deepak Adinarayana
Date:
December 25, 2001 18:01
Subject:
Help please !! ASAP !
Message ID:
20011226020028.11433.qmail@mailweb34.rediffmail.com

Hi All,

I am a beginner with PERL and I have a small query here.Please look thro' these lines of code below where I am trying just to extract the HTML source by supplying the link as in the code.But I end up getting the message



Your browser is not accepting our cookies. To view this page,please set your browser preferences to accept cookies (code 0).



in HTML format !!! :-) in the file.



Here is my code.Please suggest ways to make it work.



my $ua = new LWP::UserAgent;

my $cookie_jar = HTTP::Cookies->new;

my $url = 'http://groups.yahoo.com/group/dini/message/1452?threaded=1';

my $file = 'tryfile';

my $request = new HTTP::Request ('GET' => $url);



$cookie_jar->add_cookie_header($request);



$request->header('Accept' => 'text/html');

$request->header('Accept' => 'text/plain');



my $response;

my $response = $ua->request($request,$file);



$cookie_jar->extract_cookies($response);



Thanks in advance,

Deepak. 




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About