ruby - ChromeDriver Ruby 禁用图像

标签 ruby image webdriver watir selenium-chromedriver

有没有办法用 ruby​​ 禁用 Chromedriver 中的图像?有一个类似的问题,但它涉及 C#,我不确定如何将它移植到 ruby​​。

Disable images in Selenium ChromeDriver

最佳答案

对于遇到此问题并使用 chrome headless 的任何人,这里是禁用图像的方法。

options = Selenium::WebDriver::Chrome::Options.new(args: ['headless', '--blink-settings=imagesEnabled=false'])
@driver = Selenium::WebDriver.for(:chrome, options: options)

关于ruby - ChromeDriver Ruby 禁用图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15230894/

相关文章:

java - JTable 中的 JComboBox 中的图像在选择后仅显示路径名

selenium - Protractor : ERROR - Unable to start a WebDriver session

ruby 迷你测试 : Suite- or Class- level setup?

ruby-on-rails - Squeel 将字符串评估为连接的关键路径

jquery - 一对多的图像

javascript - 自动从 -9 旋转到 9 度

selenium - 如何等到Vue处理完成?

java - 元素MyElement在点(x,y)不可点击...其他元素将获得点击

ruby - GemCutter rake build 现在抛出 "undefined method ' write' for #<Syck::Emitter:...."在 Windows 上的 ruby​​ 1.9.2 上更新到 ruby​​gems 1.5.0 之后

ruby - 等到特定元素消失