selenium webdrive 默認打開瀏覽器設置


一、打開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)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM