[英]How to block images in Watir?
我認為可以是:
profile = Selenium::WebDriver::Chrome::Profile.new
profile['webkit.webprefs.loads_images_automatically'] = false
@browser = Watir::Browser.new :chrome, :profile => profile
用 :
webkit: { webprefs: { loads_images_automatically: false } } or profile: { default_content_setting_values: { images: 2 } }
prefs = {
:profile => {
:managed_default_content_settings => {
:images => 2
}
}
}
b = Watir::Browser.new :chrome, :prefs => prefs
手動禁用在瀏覽器 Watir 驅動器中顯示圖像,然后運行 Watir 腳本。 據我所知,你不能從 Watir 本身做到這一點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.