谷歌浏览器:
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)
原文地址:https://www.cnblogs.com/jdm532000/p/9559607.html
时间: 2024-10-03 19:46:10