perl 模拟post提交
对于post分页的网站,用正常的在url后面加参数的方法已经不奏效(大多数情况下是可以的)。就需要用到LWP::UserAgent模块去post提交。use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
my $SUSUI_URL = "http://www.pilotage.jp/products/list.php?category_id=21";
my $response= $browser->post( $SUSUI_URL, [ 'disp_number' => 20,'pageno' => 2 ] );
if ( $response->is_success ) {
print $response->content;
}
else {
print "Bad luck this time\n";
}
页:
[1]