Selenium 執行driver = webdriver.Firefox()時報錯解決方案


執行 driver = webdriver.Firefox() 時,報錯如下:

 

 原因:火狐瀏覽器安裝目錄下沒有geckodriver驅動

解決方法:

1、下載geckodriver驅動,放到Firefox安裝目錄下,如:C:\Program Files\Mozilla Firefox

2、然后把目錄路徑添加到系統環境變量path下

3、重啟腳本

 

安裝三大瀏覽器驅動driver

1.chromedriver 下載地址:https://code.google.com/p/chromedriver/downloads/list

或者:http://chromedriver.storage.googleapis.com/index.html

2.Firefox的驅動geckodriver 下載地址:https://github.com/mozilla/geckodriver/releases/

3.IE的驅動IEdriver 下載地址:http://www.nuget.org/packages/Selenium.WebDriver.IEDriver/

 


免責聲明!

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



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