웹 사이트 에서 $ua - > 에이전트 ("Mozilla / 8.0") 에 대한 검사

[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");

좋은 웹페이지 즐겨찾기