explaingit

friendsofphp/goutte

9,202PHPAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

Goutte is a deprecated PHP library for scraping websites, visit pages, extract data with CSS selectors, and submit forms in code. New projects should use Symfony's HttpBrowser component directly instead.

Mindmap

mindmap
  root((goutte))
    What it does
      Visit websites
      Extract HTML data
      Submit forms
      Follow links
    Status
      Deprecated since v4
      Migrate to Symfony
    Tech stack
      PHP 7.1 plus
      Composer install
    Symfony components
      BrowserKit
      DomCrawler
      CssSelector
      HttpClient
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Scrape data from a website by visiting pages with CSS selectors and extracting text in PHP code.

USE CASE 2

Automate form submission on a website from PHP without launching a real browser.

USE CASE 3

Migrate existing Goutte-based scrapers to the Symfony HttpBrowser component by swapping the client class name.

Tech stack

PHPSymfonyComposer

Getting it running

Difficulty · easy Time to first run · 5min

Deprecated, new projects should install symfony/browser-kit directly via Composer, Goutte v4 is just a thin wrapper around it.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Goutte is a PHP library for web scraping: it lets you write code that visits websites, reads their content, and extracts data from HTML pages without needing a real browser. You can use it to pull information from websites automatically, navigate between pages, click links, and submit forms. The basic workflow is to create a client, point it at a URL, and get back a crawler object that lets you search through the page using CSS selectors. From there you can pull out text, follow links, or fill in and submit forms, all from PHP code. However, the README is clear that Goutte is deprecated. Starting with version 4, the library became a thin wrapper around a Symfony component called HttpBrowser. If you have existing code that uses Goutte, the migration is straightforward: replace Goutte\Client with Symfony\Component\BrowserKit\HttpBrowser in your code. New projects should use the Symfony components directly rather than Goutte. Under the hood, Goutte is built on four Symfony components: BrowserKit for browser-like navigation, DomCrawler for searching HTML structure, CssSelector for using CSS-style queries to find page elements, and HttpClient for making the actual HTTP requests. These components have their own documentation and are actively maintained by the Symfony project. The library requires PHP 7.1 or higher and installs via Composer, the standard PHP package manager, with a single command. It is released under the MIT license. The name is pronounced like "goot" to rhyme with "boot."

Copy-paste prompts

Prompt 1
I have PHP code using Goutte\Client for web scraping. Show me exactly how to migrate it to Symfony\Component\BrowserKit\HttpBrowser.
Prompt 2
Using Symfony's HttpBrowser component, write PHP code to scrape a product name and price from a webpage using CSS selectors.
Prompt 3
How do I fill in and submit an HTML login form programmatically using Symfony's BrowserKit component in PHP?
Prompt 4
I'm using Goutte version 3. Should I upgrade to version 4 or migrate to Symfony HttpBrowser directly, what's the difference?
Open on GitHub → Explain another repo

← friendsofphp on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.