1 #!/usr/bin/perl -w 2 use strict; 3 use LWP::UserAgent; 4 5 my $useragent = new LWP::UserAgent; 6 my $url = ‘http://www.baidu.com‘; 7 my $request = HTTP::Request->new(GET => $url); 8 my $repose = $useragent->request($request); 9 print $repose->as_string; 10 #网站源码 11 print "\n",$repose->status_line, "\n"; 12 #响应码
时间: 2024-10-06 19:03:20