`
kankan1218
  • 浏览: 271932 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

perl 模拟post提交

    博客分类:
  • perl
阅读更多
对于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";
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics