bytebuff / SeleniumReality

Selenium启动真实浏览器!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

如何禁止js和图片加载

a1023182899 opened this issue · comments

prefs = {
'profile.default_content_setting_values': {
'images': 2,
'javascript': 2 # 2即为禁用的意思
}
}
self.chrome_options.add_experimental_option('prefs', prefs)
报错:
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: cannot parse capability: goog:chromeOptions
from invalid argument: unrecognized chrome option: prefs