selenium - 双破折号 (--) 在 Selenium ChromeOptions 中意味着什么

标签 selenium google-chrome selenium-chromedriver chromium chrome-options

我正在将 selenium 与 java 一起使用,并且正在使用一些 chrome 选项。但是我在不同的来源中看到了 chrome 选项的不同用法。我的意思是有些人在选项前使用双破折号,有些人不使用(例如 disable-dev-shm-usage--disable-dev-shm-usage )。这两种用法有什么区别吗?

最佳答案

根据 Command-Line Options :

Unix tradition encourages the use of command-line switches to control programs, so that options can be specified from scripts. There are three conventions to distinguish command-line options from ordinary arguments as follows:

  • The original Unix style
  • The GNU style
  • The X toolkit style

The GNU style uses option keywords (rather than keyword letters) preceded by two hyphens. It evolved years later when some of the rather elaborate GNU utilities began to run out of single-letter option keys (this constituted a patch for the symptom, not a cure for the underlying disease). It remains popular because GNU options are easier to read than the alphabet soup of older styles. GNU-style options cannot be ganged together without separating whitespace.



选择了 GNU 双连字符选项引导符,以便可以在同一命令行中明确混合传统的单字母选项和 GNU 样式的关键字选项。

关于selenium - 双破折号 (--) 在 Selenium ChromeOptions 中意味着什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60039687/

相关文章:

javascript - 如何使用 jasmine javascript 获取 selenium webdriver 中的 xpath 计数?

javascript - Protractor 给出 "Unable to start a WebDriver session"错误

css - Margin+padding 在 Chrome 上没有补偿

Python 3.6 - 使用 google-image-download 进行图像抓取

python - selenium with python - 自动点击元素并跳过特定的 html 类

centos - 未知错误 : Chrome failed to start: exited abnormally (Driver info: chromedriver=2. 34.522913

python - 是否可以在不将模块安装到您的计算机上的情况下使用它?

python - Selenium -Firefox : Firefox browser crashes when running my Selenium script

python - 如何修复尝试使用 Selenium 查找元素时引发的 TypeError?

Html 正斜杠显示不正确(Chrome 和 Edge)