1. 程式人生 > >Selenium,解決Message: 'geckodriver' executable needs to be in PATH

Selenium,解決Message: 'geckodriver' executable needs to be in PATH

images x86 解壓 files src cati ica sage 路徑

Windows系統解決辦法如下:

Firefox:

1、下載geckodriver.exe:
下載地址:https://github.com/mozilla/geckodriver/releases
請根據系統版本選擇下載;(如Windows 64位系統)
2、下載解壓後將getckodriver.exe復制到瀏覽器安裝目錄,如:C:\Program Files (x86)\Mozilla Firefox,然後目錄路徑添加到環境變量path下;再把geckodriver復制到pythonan安裝目錄,如:C:\Users\Wuhl\AppData\Local\Programs\Python\Python35

chrome:

1、下載chromedriver

驅動的下載地址如下:
http://chromedriver.storage.googleapis.com/index.html

chromedriver與chromed版本對應

技術分享

2、下載解壓後將chromedriver.exe復制到瀏覽器安裝目錄,如:C:\Program Files (x86)\Google\Chrome\Application(可能不需要這一步),然後目錄路徑添加到環境變量path下(可能不需要這一步);再把chromedriver.exe復制到pythonan安裝目錄,如:C:\Users\Wuhl\AppData\Local\Programs\Python\Python35

Selenium,解決Message: 'geckodriver' executable needs to be in PATH