我正在使用Selenium,并试图自动点击网页上的一个按钮,但Chrome通知"Chrome是由自动测试软件"Chrome"控制的;每次运行程序时都会弹出。如何自动禁用此通知?
我在Java中看到了这个解决方案:
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
options.setExperimentalOption("excludeSwitches",Collections.singletonList("enable-automation"));
WebDriver driver = new ChromeDriver(options);
我该如何用Python编写这段代码?
chrome_options = webdriver.ChromeOptions();
chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']);
driver = webdriver.Chrome(options=chrome_options);
从第一个谷歌简历:https://help.applitools.com/hc/en-us/articles/360007189411--Chrome-is-being-controlled-by-automated-test-software-notification