You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 1, 2023. It is now read-only.
Goutte is a screen scraping and web crawling library for PHP.
Goutte provides a nice API to crawl websites and extract data from the HTML/XML
responses.
WARNING: This library is deprecated. As of v4, Goutte became a simple proxy
to the HttpBrowser class
from the Symfony BrowserKit component. To
migrate, replace Goutte\Client by
Symfony\Component\BrowserKit\HttpBrowser in your code.
Requirements
Goutte depends on PHP 7.1+.
Installation
Add fabpot/goutte as a require dependency in your composer.json file:
composer require fabpot/goutte
Usage
Create a Goutte Client instance (which extends
Symfony\Component\BrowserKit\HttpBrowser):
useGoutte\Client;
$client = newClient();
Make requests with the request() method:
// Go to the symfony.com website$crawler = $client->request('GET', 'https://www.symfony.com/blog/');
The method returns a Crawler object
(Symfony\Component\DomCrawler\Crawler).
To use your own HTTP settings, you may create and pass an HttpClient
instance to Goutte. For example, to add a 60 second request timeout: