salimibrohimi/web-resource-extractor
最新稳定版本:1.0
Composer 安装命令:
composer require salimibrohimi/web-resource-extractor
包简介
Simple and lightweight PHP class for downloading Web pages.
README 文档
README
Simple and lightweight PHP class for downloading Web pages.
Download via composer:
composer require salimibrohimi/web-resource-extractor
Examples on how to use this class.
$extractor = new WebResourceExtractor(true, '/cache/', 3600);
$extractor->setUserAgent('YOUR USER AGENT');
$extractor->followLocation(5); // allow cURL to follow redirects.
// Example #1. Extract a single Web resource.
$results = $extractor->extractWebResource('https://en.wikipedia.org/wiki/Main_Page', '', '', true, false);
// Example #2. Extract multiple Web resources by relative URLs.
$urls = [
['wiki/Wikipedia:Contents', '', '', true],
['wiki/Portal:Current_events', '', '', false],
'wiki/Wikipedia:About',
'wiki/404',
];
$results = $extractor->extractMultipleWebResources($urls, 'https://en.wikipedia.org', 15);
// Example #3. Extract multiple Web resources by absolute URLs.
$urls = [
'https://en.wikipedia.org',
'https://tg.wikipedia.org',
];
$results = $extractor->extractMultipleWebResources($urls);
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2022-11-26