用 LWP提交WEB页面的POST表单
参考:
- Web Basics with LWP
- LWP內的模組](http://blog.pixnet.net/jck11/post/5045536)
#!/usr/bin/perl
use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
$browser->cookie_jar({});
push @{ $browser->requests_redirectable }, 'POST';
my $response = $browser->post($url,content => [ %form ] );
print $response->error_as_HTML unless $response->is_success;
print $response->content;
指定Referer
#!/usr/bin/perl
use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
$browser->cookie_jar({});
my $url=$site.'/literature/indextext9.asp?free=100112699&page=101605396';
my $req = new HTTP::Request GET => $url;
$req->referer($site);
my $res = $browser->request($req);
通过http proxy代理获取网页
见:http://community.activestate.com/forum-topic/lwp-https-requests-proxy
没有评论:
发表评论