Registry / testing / symfony-browser-kit

symfony-browser-kit

JSON →
library8.1.0phppackagistunverified

Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically

composer require symfony/browser-kit
INSTALL
IMPORT
SIG · SYMFONY-BROWSER-KI
S
symfony-browser-kit
testingphpv8.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HttpBrowser
use Symfony\Component\BrowserKit\HttpBrowser;

Make a GET request and extract text from an h1 element

use Symfony\Component\BrowserKit\HttpBrowser; use Symfony\Component\HttpClient\HttpClient; $browser = new HttpBrowser(HttpClient::create()); $crawler = $browser->request('GET', 'https://example.com'); echo $crawler->filter('h1')->text();
Debug
Known issues
gotchaBrowserKit requires an HTTP client implementation (e.g., `symfony/http-client`) to make actual requests; using it without one will throw an exception.
fix
Install `symfony/http-client` or provide a custom client implementing `HttpClientInterface`.
affects: >=4.0
Upgrade
Version history
8.1.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Resources
symfony-browser-kit — pip install symfony-browser-kit · libregistry