谷歌浏览器:
google_path=r'--user-data-dir=C:\Users\jdm\AppData\Local\Google\Chrome\User Data'
option=webdriver.ChromeOptions()
option.add_argument(google_path)
driver=webdriver.Chrome(chrome_options=option)
火狐浏览器:
firefox_path=r'C:\Users\jdm\AppData\Roaming\Mozilla\Firefox\Profiles\7elc1ibd.default'
profile=webdriver.FirefoxProfile(firefox_path)
driver=webdriver.Firefox(profile)