|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi
i am trying to get cookie information from a remote site (shoping catalog), however for this particular site the HTTP::Cookie action has no effect. I have tried the same code just changing the url on a number of diffrent sites , cnn.com,mail.yahoo.com and everyone.net they all give diffrent results , but the site i want to work doesnt give anything (see code for results of tests on all sites). i have listed my code below if someone can help #!/usr/local/bin/perl -w print "Content-type: text/html\n\n"; use LWP::Simple; use HTTP::Request::Common qw(POST); use HTTP::Request::Common qw(GET); use LWP::UserAgent; use HTTP::Cookies; ### CNN .com - the cookies.txt is updated #$url = "http://www.cnn.com"; ### Everyone.net the cookies.txt is not updated but the cookie appears in windows/cookies #$url = "http://www.everyone.net"; ##### Yahoo .com - the coookies.txt file is updated. #$url = "http://mail.yahoo.com"; ### Test site using Actinic catalog - cookies.txt not updated and cookie doesnt appear in windows/cookies $url = "http://deepinthewoods.org/cgibin/ca000001.pl?PRODREF=23&RANDOM=NETQUOTEVAR:RANDOM&PATH=../www/acatalog/&PAGE=PRODUCT&SECTION_BLOB=A0004.cat"; $cookie_file = "/xxxxxxx/xxxx/cookies.txt"; $ua = LWP::UserAgent->new(); $ua->agent("Mozilla/4.51 [en]"); $cookie_jar = HTTP::Cookies->new( file => $cookie_file, ,ignore_discard => 1); $cookie_jar->load($cookie_file); $request = HTTP::Request->new(GET => $url); $cookie_jar->load; $cookie_jar->add_cookie_header($request); $response = $ua->request($request); $cookie_jar->extract_cookies($response); #print $cookie_jar->as_string() ; $cookie_jar->save($cookie_file); print $response->as_string(); Regards Waseem |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > HELP ME V.URGENT |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|