Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<b>Fatal error</b>: Uncaught Exception: This is not a php webdriver client #8

Open
RestOp opened this issue Aug 7, 2022 · 2 comments

Comments

@RestOp
Copy link

RestOp commented Aug 7, 2022

Hello

i get

Fatal error: Uncaught Exception: This is not a php webdriver client in /usr/share/nginx/html/vendor/sapistudio/seleniumstealth/src/SeleniumStealth.php:97

i am use last version of https://github.com/php-webdriver/php-webdriver

Why could it be?

Thanks a lot!

@RestOp
Copy link
Author

RestOp commented Aug 7, 2022

i start sesison like this

    $settings['driver'] = RemoteWebDriver::create(
        $settings['serverUrl'], 
        $settings['capabilities'],
        $settings['connectionTimeout'], // Connection timeout in miliseconds
        $settings['requestTimeout']  // Request timeout in miliseconds
    );

and then
$settings['driver'] = (new SeleniumStealth('driver'))->usePhpWebriverClient()->makeStealth();

@RestOp
Copy link
Author

RestOp commented Aug 7, 2022

The whole code so you could easy to understand

namespace Facebook\WebDriver;

use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\WebDriverCapabilityType; 
use SapiStudio\SeleniumStealth\SeleniumStealth;

error_reporting(E_ALL & ~E_NOTICE);
ini_set('error_reporting', E_ALL & ~E_NOTICE);

require_once('vendor/autoload.php');

$serverUrl = 'http://192.168.188.20:4444';
$capabilities = DesiredCapabilities::chrome();
$fetchURL = "https://google.com";

$driver = RemoteWebDriver::create($serverUrl , $capabilities, 360 * 1000,  360 * 1000);
$driver = (new SeleniumStealth(driver))->usePhpWebriverClient()->makeStealth();
$driver->get($fetchURL); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant