GoutteDriver¶
GoutteDriver provides a bridge for the Goutte headless browser. Goutte is a classical pure-php headless browser, written by the creator of the Symfony framework Fabien Potencier.
Note
The GoutteDriver extends the BrowserKitDriver to fix a small edge case in the Goutte implementation of BrowserKit. It is also able to instantiate the Goutte client automatically.
Installation¶
GoutteDriver is a pure PHP library available through Composer:
$ composer require behat/mink-goutte-driver
Usage¶
In order to talk with Goutte, you should instantiate a
Behat\Mink\Driver\GoutteDriver
:
$driver = new \Behat\Mink\Driver\GoutteDriver();
Also, if you want to configure Goutte more precisely, you could do the full setup by hand:
$client = new \Goutte\Client();
// Do more configuration for the Goutte client
$driver = new \Behat\Mink\Driver\GoutteDriver($client);