chromeOptions 是一个配置 chrome 启动是属性的类。通过这个类,我们可以为 chrome 配置如下参数(这个部分可以通过 selenium 源码看到):

配置参数
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
原理分析

class Options(object):
    KEY = "goog:chromeOptions"

    def __init__(self):
        self._binary_location = ''
        self._arguments = []
        self._extension_files = []
        self._extensions = []
        self._experimental_options = {}
        self._debugger_address = None
        self._caps = DesiredCapabilities.CHROME.copy()


    def add_experimental_option(self, name, value):
        """
        Adds an experimental option which is passed to chrome.

        Args:
          name: The experimental option name.
          value: The option value.
        """
        self._experimental_options[name] = value


↙↙↙阅读原文可查看相关链接,并与作者交流