cdherold has asked for the wisdom of the Perl Monks concerning the following question:
I am using WWW::Mechanize to follow a redirect within a website (http://www.nature.com/nature/index.html). I would like Mechanize to follow the redirect that occurs on clicking the journal cover (with URL link: http://www.nature.com/nature/current_issue). The redirect shuttles the browser to a URL that includes specifics on the date of the issue, but does not include the base URL address (http://www.nature.com). I am using the following code:
my $agent = WWW::Mechanize->new( autocheck => 1); $agent->get($url); die $agent->response->status_line unless $agent->success; $output = $agent->content; print $output;
The code follows the redirect, however, the redirect URL address is local not global; hence, I end up on a page that is only a partial UTL i.e. "The requested URL /nature/journal/v449/n7161/ was not found on this server."
How do I get Mechanize to fill in the global URL?
Most Humblely,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Redirect with Mechanize
by grinder (Bishop) on Sep 30, 2007 at 20:19 UTC | |
|
Re: Redirect with Mechanize
by hossman (Prior) on Sep 30, 2007 at 22:40 UTC | |
by karavay (Beadle) on Sep 30, 2007 at 23:05 UTC | |
|
Re: Redirect with Mechanize
by perrin (Chancellor) on Sep 30, 2007 at 20:37 UTC | |
|
Re: Redirect with Mechanize
by sanPerl (Friar) on Oct 01, 2007 at 07:26 UTC |