LWP::Simple(3) User Contributed Perl Documentation LWP::Simple(3)
NAME
LWP::Simple - simple procedural interface to LWP
SYNOPSIS
perl -MLWP::Simple -e 'getprint "http://www.sn.no"'
use LWP::Simple;
$content = get("http://www.sn.no/");
die "Couldn't get it!" unless defined $content;
if (mirror("http://www.sn.no/", "foo") == RC_NOT_MODIFIED) {
...
}
if (is_success(getprint("http://www.sn.no/"))) {
...
}
DESCRIPTION
This module is meant for people who want a simplified view of the libwww-perl library. It should also be suitable for one-liners.
If you need more control
LWP::Simple 模块
最新推荐文章于 2019-11-27 11:23:38 发布
LWP::Simple 是 Perl 中一个简化版的 libwww-perl 库接口,适用于简单的一行脚本。提供了 get、head、getprint、getstore 和 mirror 等函数用于网页抓取。如果需要更多控制或访问响应头,建议使用 LWP::UserAgent 模块。此模块还导出 HTTP::Status 常量和方法,如 is_success 和 is_error,用于检查 HTTP 响应代码。
摘要由CSDN通过智能技术生成