Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ChromeDriver Ruby disable images

Is there a way to disable images in Chromedriver with ruby? There is a similar question but it deals with C# and I am not exactly sure how to port it over to ruby.

Disable images in Selenium ChromeDriver

like image 635
cubesnyc Avatar asked Apr 17 '26 18:04

cubesnyc


1 Answers

For anyone who comes across this and is using chrome headless, here is how to disable images.

options = Selenium::WebDriver::Chrome::Options.new(args: ['headless', '--blink-settings=imagesEnabled=false'])
@driver = Selenium::WebDriver.for(:chrome, options: options)
like image 107
akaDanPaul Avatar answered Apr 19 '26 11:04

akaDanPaul