问题
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(
'--blink-settings=imagesEnabled=false'
));
https://github.com/facebook/php-webdriver/issues/641#issuecomment-512255496
来源:https://stackoverflow.com/questions/56072260/disable-image-loading-with-php-selenium