from selenium import webdriver
from selenium.webdriver.chrome.options import Options as CHOptions
from selenium.webdriver.edge.options import Options as EDOptions
1、不要自动关闭浏览器
option = EDOptions()
option.add_experimental_option('detach', True)
# 2、去掉自动化标识
option.add_experimental_option('excludeSwitches', ['enable-automation'])
option.add_argument('--disable-blink-features=AutomationControlled')
# 3、关闭保存密码弹窗
prefs = {}
prefs['credentials_enable_service'] = False
prefs['profile.password_manager_enabled'] = False
option.add_experimental_option('prefs', prefs)
self.driver = webdriver.Edge(options=option)
版权归原作者 angboom 所有, 如有侵权,请联系我们删除。