manishgs / scraper
PHP 网页抓取包
v0.1.1
2015-12-10 15:18 UTC
Requires
- fabpot/goutte: 2.*
This package is not auto-updated.
Last update: 2024-09-14 18:47:27 UTC
README
此包使用 Goutte 来爬取网页并从 URL 中提取数据(favicon,标题,描述,特色图像等)。
安装
在您的 composer.json 文件中将 manishgs/scraper 添加为依赖项
composer require manishgs/scraper:^0.1.0
用法
use Scraper\Grab; // create new Grab $grab = new Grab(); // set Url $grab = $grab->setUrl('http://google.com'); // extract data $article = $grab->getInfo(); print_r($article);