I added geckodriver.exe into PATH as you can see on this image and i restarted my computer after. But the error still show up.
Here's my code :
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://stackoverflow.com')
Do you have clues about what I did wrong ?
There are three ways to resolve this error.
Set the environment variable "webdriver.gecko.driver" with driver path as value.
os.environ["webdriver.gecko.driver"]="c:\geckodriver.exe"
Pass executable path to the constructor like
driver = WebDriver.Firefox("path of executable")
Are you setting the capabilities correctly? In case you are setting the version capability, verify that it is correct or remove it altogether. I am talking of the below:
I don't see any significant error in your code block. While working with Selenium 3.4.3, geckodriver v0.17.0, Mozilla Firefox 53.0 with Python 3.6.1 you can consider downloading the geckodriver and save it anywhere in your machine and configuring the absolute path of the geckodriver through
executable_path
.Here is your own code block which executes well at my end: