I have uses WWW::Mechanize::Shell with great sucess in the past, but

currently I am trying to access the url



https://www.setsivr.odjfs.state.oh.us/welcome.asp



programmatically via perl. When I access the page with WWW::Mechanize::Shell

or LWP::UserAgent or even Lynx for that matter, the browsers land on a page

called cookieerror.htm:



[EMAIL PROTECTED] temp]$ perl -MWWW::Mechanize::Shell -e 'shell'

>get https://www.setsivr.odjfs.state.oh.us/welcome.asp

Retrieving https://www.setsivr.odjfs.state.oh.us/welcome.asp(200)

https://www.setsivr.odjfs.state.oh.us/cookieerror.htm>



There is no client script in the document.



Following is some bare bones code that sould be able to be modified easily

to get the desired results, if one knew what it was missing.



If someone could show me what I am missing I would really appreciate it.



use warnings;

use strict;



my $domain = 'https://www.setsivr.odjfs.state.oh.us/';



my $file; my $req; my $res;

use LWP::UserAgent;

use HTTP::Cookies;



my $ua = LWP::UserAgent->new;

my $cj = HTTP::Cookies->new();

$ua->requests_redirectable( [ ] );



$file = $domain . 'welcome.asp';

print("fetching: $file\n");

$req = HTTP::Request->new( GET => $file );

$res = $ua->request($req);

$cj->extract_cookies( $res );



# $res->{_headers}->header('Location') eq 'cookiecheck.asp'

$file = $domain . $res->{_headers}->header('Location');

print("fetching: $file\n");

$req = HTTP::Request->new( GET => $file );

$cj->add_cookie_header( $req );

$res = $ua->request($req);

$cj->extract_cookies( $res );



#print("cookie headers:\n",  $cj->as_string, "\n");

print("response headers:\n",  $res->{_headers}->as_string, "\n");



TIA for all responses,



Todd W.



_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

Reply via email to