- 论坛徽章:
- 0
|
的确是http头没有设置
my $header = {
'Accept' =>'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language' => 'zh-CN',
'Accept-Encoding' => 'text/html',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3)',
};
my @urls = ('');
my $cv = AnyEvent->condvar;
for my $url ( @urls ) {
$cv->begin;
http_get
$url,
headers =>$header,
sub {
my ($data, $headers) = @_;
use Data: umper;
print Dumper($headers);
$cv->end;
}
}
$cv->recv;
|
|