I am using Watir for a data fetching job where I don't need any images to be loaded. Is it possible to block them?
I think it can be:
profile = Selenium::WebDriver::Chrome::Profile.new
profile['webkit.webprefs.loads_images_automatically'] = false
@browser = Watir::Browser.new :chrome, :profile => profile
See: http://watir.github.io/docs/chrome/
Use :
webkit: { webprefs: { loads_images_automatically: false } } or profile: { default_content_setting_values: { images: 2 } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With