在哪里可以找到含硒的所有可用ChromeOption的列表? [英] Where can I find a list of all available ChromeOptions with selenium?

查看:144
本文介绍了在哪里可以找到含硒的所有可用ChromeOption的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里可以找到带有硒的所有可用Chrome选项的列表?

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

在python环境中使用硒进行爬网时,我不得不在chrome webdriver中使用flash. 所以我试图找到一个允许Flash的设置,然后找到了这些答案.

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-running-selenium-test

Selenium.Chrome在哪里可以找到所有可用的ChromeOption参数的列表? 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
  • 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.

推荐答案

  1. 在Chrome地址栏中打开chrome://version
  2. 打开配置文件路径:的文件夹,将会有一个文件perference

  1. open chrome://version in chrome address bar
  2. open the folder of Profile Path:, there will be a file perference

复制并打开perference文件,它是一个JSON文件,您可以使用JSON格式化程序或J SON在线查看器.
重要,请打开已复制的副本,以免更改后的Chrome失效.

copy and open the perference file, it's a JSON file, you can use JSON formater or JSON viewer online.
important, please open the copied one to avoid break your chrome if you did changes.

我认为与profile.content_settings

或者,您可以在当前用户个人资料中预先配置Flash设置(chrome://settings/content/flash),并使用用户个人资料来构建ChromeOptions.

Alternative, you can pre-config the flash settings(chrome://settings/content/flash) in current user profile and use user profile to build ChromeOptions.

一些参考资料:

Some reference:

  • Manage Flash in Chrome
  • Default user preferences
  • Preferences vs. Policies
  • Policy List
  • Policy List - DefaultPluginsSetting

该政策更接近于使用注册表/系统级别设置来在一台计算机上影响所有用户;用户配置文件下的首选项工作仅影响一个用户,用户可以使用它根据策略设置进行自定义.但是政策的优先级高于优先级".

Policy more close to using registry/system level setting to effect all users in one machine; Preference work under user profile only effect one user, user can use it to customize upon Policy settings. But Policy has higher priority than Preference.

这篇关于在哪里可以找到含硒的所有可用ChromeOption的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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