5

Where can I find a list of all available Chrome Options with selenium?

While crawling with selenium in a python environment, I had to use flash in the chrome webdriver. so I tried to find a setting that would allow Flash and I found these answers.

https://sqa.stackexchange.com/questions/30312/enable-flash-player-on-chrome-62-while-running-selenium-test

Selenium.Chrome where can I find a list of all available ChromeOption arguments? C#

but I really want to find official document about these arguments :

  • profile.default_content_setting_values.plugins
  • profile.content_settings.plugin_whitelist.adobe-flash-player

I think that exist because some people said like above two answers. but I can't found it.

4

2 回答 2

4
  1. chrome://version在 chrome 地址栏中打开
  2. 打开Profile Path:的文件夹,会有一个文件perference 在此处输入图像描述

  3. 复制并打开perference文件,它是一个 JSON 文件,你可以使用 JSON formater 或 J SON viewer online
    重要的是,如果您进行了更改,请打开复制的一份以避免损坏您的 chrome。

  4. 我觉得下flash相关的配置profile.content_settings

  5. chrome://settings/content/flash在 chrome 地址栏中打开,做你想要的 flash 设置,你的更改将被更新到perference文件中,
  6. 找出更新文件和复制perference文件之间的区别。不同之处应该是您想要 chrome 偏好。
  7. 在构建 ChromeOptions 时设置优先级,例如profile.content_settings.xxx=xxx 在此处输入图像描述

或者,您可以在当前用户配置文件中预先配置闪存设置(chrome://settings/content/flash)并使用用户配置文件来构建 ChromeOptions。 在此处输入图像描述

一些参考:

策略更接近于使用注册表/系统级别设置来影响一台机器上的所有用户;用户配置文件下的偏好工作只影响一个用户,用户可以使用它来自定义策略设置。但是 Policy 的优先级高于 Preference。

于 2018-01-20T11:44:42.030 回答
3

以下是最广泛使用的ChromeDriver属性和ChromeOptions的链接:

于 2018-01-20T08:32:58.140 回答