一、打開cmd
1. cd C:\program files\mozilla firefox(Firefox安裝目錄)
2. 執行: firefox.exe -ProfileManager -no-remote
二、增加新的配置
在打開的窗口中(上圖)選擇創建配置文件,完事點擊【啟動Firefox】
三、將新生成的配置文件指定給selenium webdrive
1. 生成配置文件路徑:C:\Users\zach\AppData\Roaming\Mozilla\Firefox\Profiles\
2. 將生成的配置文件寫入代碼
browser_path = 'C:\Users\zach\AppData\Roaming\Mozilla\Firefox\Profiles\gfk3atbn.selenium'
driver = webdriver.Firefox(browser_path)