Qing, Keary, and Friends,
I am having the same problem you're having. Please
help.
I have a script that gets data from various sites.
One of the sites suddenly uses a redirect in the url.
I used to go to www.site.com/123.html. Now
www.site.com/123.html redirects to
xyz.site.com/231.html. The data fields and everything
else is the same, except I am not able to get any
information.
Keary mentioned:
"LWP will only redirect on an HTTP redirect (e.g.
status 302). Web sites may use other methods to
simulate a redirect, such as JavaScript or META
refresh, which LWP doesn't parse and handle."
If this is the case, how can I get around a Javascript
or META refresh?
Any suggestions or information would be appreciated.
I am fairly new to Perl. Thank you.
Ben
-----
Hi, All
I have one question about the redirection. The
following is my code:
use LWP::UserAgent;
my $ua=LWP::UserAgent->new;
my $req=HTTP::Request->new
(GET=>'http://www.somedomainhere.com/redirect/mdm2.htm');
# this URL should be
directed to another one
my $res=$ua->request($req);
my $string = $res->content;
But when I run the program, it didn't
automatically redirect to another web
URL. It just show me "The web page has been
removed.... blah blah". According to
LWP document, the request "GET" should be in the
redirect list. Why it doesn't
work? Could someone help me for this? Thanks!
Qing
http://archive.develooper.com/[EMAIL PROTECTED]/msg04787.html?x