如何在 Watir 中阻止图像? [英] How to block images in Watir?

查看:16
本文介绍了如何在 Watir 中阻止图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Watir 进行数据获取工作,我不需要加载任何图像.可以屏蔽吗?

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?

推荐答案

我认为可以:

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

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

参见:http://watir.github.io/docs/chrome/

这篇关于如何在 Watir 中阻止图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆