Selenium
Selenium Driver for Falcon
Wrapper for php-webdriver/webdriver (opens in a new tab).
Installation
composer require antheta/falcon-drivers
Usage
The SeleniumDriver has to be added to Falcon in order to use it:
$falcon = Falcon::getInstance();
// add SeleniumDriver
$falcon->addDrivers([
"selenium" => \Antheta\Selenium\SeleniumDriver::class
]);
// set selenium as the default driver
$falcon->useDriver("selenium");
// required options
$falcon->addOptions([
"server_url" => "http://localhost:4444" // selenium server url
]);
// scrape using selenium
$falcon->run('...');
// add custom driver specific logic here
$element = $falcon->getDriverInstance()
->findElement(\Facebook\WebDriver\WebDriverBy::cssSelector('a.thumb-hover'))
->getText();
$falcon->getDriverInstance()->quit();
// results
$falcon->parse()->results();