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(
    '--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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!