selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH with GeckoDriver Selenium Firefox

流过昼夜 提交于 2019-12-02 07:21:38

The error says it all :

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

Which implies that GeckoDriver binary is not in the Classpath

While working with Selenium v3.x you have to download the latest GeckoDriver from this url and store it in your system and mention the absolute path while initiating the webdriver and Web Browser session as follows :

from selenium import webdriver

driver = webdriver.Firefox(executable_path="C:\\path\\to\\geckodriver.exe")
driver.get("https://auth.edgenuity.com/Login/Login/Student")
button = driver.find_element_by_id('LoginSubmit')
button.click()

For what little help it might be, the critical parts of the traceback are

FileNotFoundError: [WinError 2] The system cannot find the file specified

line 3, in <module>
driver = webdriver.Firefox()

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' 
executable needs to be in PATH.

It seems that the Firefox webdriver isn't in the defined search path that your main program sees. There's something called geckodriver that isn't available.

Check your installation and configuration for this package. Consult with your class instructors and classmates for help. I suspect that the repair is something with your local set-up, beyond our knowledge here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!