【发布时间】:2020-04-29 23:06:05
【问题描述】:
这个方法我试过了,但是没用。
prefs = {
:profile => {
:managed_default_content_settings => {
:images => 2
}
}
}
Watir::Browser.new :chrome, :prefs => prefs
browser.goto "http://www.example.com"
【问题讨论】:
-
试试
webkit: { webprefs: { loads_images_automatically: false } }或profile: { default_content_setting_values: { images: 2 } } -
您需要 Watir 吗?还是无论如何?
-
我需要 Watir,因为我的自动化代码在 Watir 中
-
@Stefan 我已经尝试了两种方法仍然显示图像..
-
可以在没有图像的情况下使用 Selenium 启动,然后使用 watir