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,
In reply to Redirect with Mechanize by cdherold
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |