0
1
SMStefan Marx
The code first creates a ChromeOptions object, which contains the following two options:
{ "add_experimental_option": "excludeSwitches", "useAutomationExtension": false }
Then, it creates a driver object, specifying the options object as the ChromeOptions object's parameter.
The driver object will use the options specified in the options object to control the behavior of the Chrome browser.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options)