php-webdriver

Disable image loading with PHP Selenium

老子叫甜甜 提交于 2019-12-13 20:25:03
问题 How do you disable image loading in ChromeOptions? (PHP library) I tried the following but not sure if syntax is correct $options = new ChromeOptions(); // disable images $options->addArguments(array( "service_args=['--load-images=no']" )); $caps = DesiredCapabilities::chrome(); $caps->setCapability(ChromeOptions::CAPABILITY, $options); $driver = RemoteWebDriver::create($host, $caps); 回答1: To disable, use the argument: --blink-settings=imagesEnabled=false $options->addArguments(array( '-

PHP Fatal error: Uncaught Error: Class 'Facebook\WebDriver\ChromeOptions' not found

最后都变了- 提交于 2019-12-10 19:23:31
问题 namespace Facebook\WebDriver; use Facebook\WebDriver\Remote\DesiredCapabilities; use Facebook\WebDriver\Remote\RemoteWebDriver; require_once('vendor/autoload.php'); $host = 'http://localhost:4444/wd/hub'; $options = new ChromeOptions(); I have read this link when i creating object of class ChromeOptions getting error PHP Fatal error: Uncaught Error: Class 'Facebook\WebDriver\ChromeOptions' not found. 回答1: Try this. $options = new Chrome\ChromeOptions(); 回答2: Add use Facebook\WebDriver\Chrome