I have a program that can retrieve the content of a specific webpage, but there are some pages where I get an error:
Can't get http://www.sitename.com
302 Moved Temporarily at geturl.pl line 30.
The site displays fine on a browser.
Wonder what I could do to get the content?
My code is very simple, the standard use of LWP and works fine on most pages.
my $browser = LWP::UserAgent->new(
agent=>'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)',
keep_alive=>'1'
);
...
my $response = $browser->get($url);
Thanks!
================
update:
- Yes this is the actual code I'm using. Is there an explicit option to turn on following redirects?
- Yes wget works
Thanks