Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 9th, 2001, 05:23 AM
walshs walshs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 112 walshs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Angry

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
__________________
World Cup Football (Soccer) Forums
http://www.todayinsoccer.com

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > HELP ME V.URGENT


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway