masterkey/goutte

简单的PHP网页爬虫

安装量: 1,008

依赖者: 1

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:应用程序

1.0.4 2016-03-01 20:56 UTC

This package is auto-updated.

Last update: 2024-08-29 01:48:44 UTC


README

Build Status

Goutte 是一个用 PHP 编写的屏幕捕获和读取库。这个工具提供了一个丰富的 API 来执行 HTML/XML 响应的读取。

需求

Goutte 依赖于 PHP 5.5+ 和 Guzzle 6+。

安装

masterkey/goutte 添加到您的 composer.json 文件中的依赖项

composer require masterkey/goutte

使用方法

创建一个 Client 类的实例(它扩展了 Symfony\Component\BrowserKit\Client

use Goutte\Client;

$client = new Client();

使用 request() 方法进行请求

// Vai ao site Symfony.com
$crawler = $client->request('GET', 'http://www.symfony.com/blog/');

该方法返回一个 Crawler 对象(Symfony\Component\DomCrawler\Crawler)。

更多信息

此包基于 Goutte 包。