[root@dr-mysql01 test]# cat get.pl
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->agent("Mozilla/8.0");
my $response = $ua->get('http://mp.weixin.qq.com/s?__biz=MzA5NTcxNzY3Nw==&mid=213258239&idx=1&sn=7cfaff263b64209e43756482d5f7333e&scene=1#rd');
if ($response->is_success) {
print $response->decoded_content; # or whatever
}
else {
die $response->status_line;
}
---------------------------------------------------------------------------------------------------------------------------------------------------
use Encode;
use Encode::CN;
use URI::Escape;
use LWP::Simple;
$host = "http://http://mp.weixin.qq.com/s?__biz=MzA5NTcxNzY3Nw==&mid=213258239&idx=1&sn=7cfaff263b64209e43756482d5f7333e&scene=1#rd";
$content = get($host);
print "$content is $content
";
http://mp.weixin.qq.com/s?__biz=MzA5NTcxNzY3Nw==&mid=213258239&idx=1&sn=7cfaff263b64209e43756482d5f7333e&scene=1#rd
对$ua->agent("Mozilla/8.0"); 有判断