1.开启chrome调试模式 可操作已经打开的浏览器
自行查询,网上很多
2.添加谷歌配置,操作带有谷歌配置的浏览器
options = webdriver.ChromeOptions() options.add_argument("--user-data-dir=" + r'G:\chrome_new') #chrome:version options.add_experimental_option("excludeSwitches", ['enable-automation']) #去除被自动化软件控制 driving_path = r'G:/Google/Chrome/Application/chromedriver.exe' self.driver = webdriver.Chrome(options=options, executable_path=driving_path) # self.driver.get('网址') self.driver.implicitly_wait(10)