Gurpreet Sachdeva wrote:
>   
> Hi Guys,
>        I am using mirror function provided by the LWP:Simple Module in Perl...
> 
> My problem is that the Url I provide to download the page, redirects to some other 
> Url... Though I get the page downloaded but am not able to track the corresponding 
> redirected URL...
> 
> How can I find the redirected URL???
> 
> For eg: http://www.wn.com/usa will redirect to http://www.usaworldnews.com/...
> 
> Can anyone help me out???

You could graduate to using UserAgent with something like (it's not that
much more complicated) :

use LWP::UserAgent;

my $url = 'http://www.wn.com/usa';
my $file = "foo.html";

my $ua = new LWP::UserAgent;
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req, $file);

my $requri = $req->uri();
print "request URI = $requri\n";

my $resuri = $res->base();
print "response base URI = $resuri\n";


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to