behat/mink-goutte-driver
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
fabpot/goutte | v4.0.3 | 6.05 kB | MIT | prod | 1 |
behat/mink-goutte-driver is a powerful web scraper and testing tool used in the Mink framework. This composer package provides a Goutte driver for Mink, making it possible for developers to conduct functional tests and scrape web content while taking advantage of Goutte's fast, programmatic browser capabilities. This driver mediates between the Mink API and the Goutte client, enabling the user to navigate, extract content, and interact with websites programmatically in PHP. It’s a great tool for SEO experts for analyzing web data and improving your site's visibility.
Using the behat/mink-goutte-driver is simple and straightforward especially for developers familiar with composer and PHP. Start by installing the package. You need to include the Mink and Mink Goutte Driver packages in your project's composer.json file as shown:
{
"require": {
"behat/mink": "^1.9",
"behat/mink-goutte-driver": "^2.0"
}
}
Then, run php composer.phar install
to install the dependencies.
To use the library in your PHP code, instantiate a new Mink object with a GoutteDriver session like so:
<?php
require "vendor/autoload.php";
use Behat\Mink\Mink,
Behat\Mink\Session,
Behat\Mink\Driver\GoutteDriver,
Goutte\Client as GoutteClient;
$mink = new Mink(array(
'goutte' => new Session(new GoutteDriver(new GoutteClient())),
));
$session = $mink->getSession('goutte');
$session->visit("http://php.net/");
$session->getPage()->clickLink('Downloads');
echo $session->getCurrentUrl() . PHP_EOL;
In the above example, we create a Mink session equipped with the GoutteDriver and visit a URL. We then simulate a click on the 'Downloads' link and print out the current URL.
The comprehensive documentation for behat/mink-goutte-driver is hosted on the Mink’s GitHub repository. If you need more information on how to make the most out of this Goutte driver or details about its methods and properties, head over to Mink’s GitHub page. The repository showcases how to install, use, and contribute to the development of this library. The page includes a list of maintainers and major contributors driving the tool's growth.