需要找到chrome的User Data文件夹,替换下面代码中的路径
profile_directory = r'--user-data-dir=C:\Users\DXG\AppData\Local\Google\Chrome\User Data'
options = webdriver.ChromeOptions()
options.add_argument(profile_directory)
driver_path = r'D:/chromedriver/chromedriver.exe'
driver = webdriver.Chrome(executable_path=driver_path,options=options)
注意:在操作前必须先将chrome关闭