in reply to Navigating with WWW::Mechanize across intermediate pages
Check out the $mech->redirect_ok() option, which instructs your virtual browser (WWW::Mechanize) to follow redirects.
update 1: a simpler approach may be to parse the header yourself looking for a URI to follow. Try the following on one of your magically redirecting pages:
use WWW::Mechanize; my $mech = WWW::Mechanize->new( quiet => 1 ); $mech->get( "http://www.mysite.com/index.html" ); die( "Error getting page" ) if ( ! $mech->success() ); print( $mech->response->headers_as_string );
or alternatively if you want to see the entire message, headers included, for debugging purposes, replace ->headers_as_string with ->as_string..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Navigating with WWW::Mechanize across intermediate pages
by perrin (Chancellor) on Jun 22, 2005 at 08:23 UTC |