How to block images in Vatira?

I use Watir to fetch data where I don’t need the images that need to be uploaded. Can I block them?

+3
source share
3 answers

Disable the image display in the Watir browser manually, and then run the Watir script. As far as I know, you cannot do this from Vatir himself.

+1
source

I think it could be:

        profile = Selenium::WebDriver::Chrome::Profile.new
        profile['webkit.webprefs.loads_images_automatically'] = false

        @browser = Watir::Browser.new :chrome, :profile => profile

See: http://watir.imtqy.com/docs/chrome/

+1
source
prefs = {
    :profile => {
        :managed_default_content_settings => { 
          :images => 2
        }
    }
}

b = Watir::Browser.new :chrome, :prefs => prefs
+1
source

Source: https://habr.com/ru/post/1757627/


All Articles