I am using selenium with python and have downloaded the chromedriver for my windows computer from this site: http://chromedriver.storage.googleapis.com/index.html?path=2.15/
The best way is maybe to get the current directory and append the remaining address to it.
Like this code(Word on windows. On linux you can use something line pwd):
webdriveraddress = str(os.popen("cd").read().replace("\n", ''))+'\path\to\webdriver'
I had this problem on Webdriver 3.8.0 (Chrome 73.0.3683.103 and ChromeDriver 73.0.3683.68). The problem disappeared after I did
pip install -U selenium
to upgrade Webdriver to 3.14.1.
In my case, this error disappears when I have copied chromedriver file to c:\Windows folder. Its because windows directory is in the path which python script check for chromedriver availability.
If you are using remote interpreter you have to also check if its executable PATH is defined. In my case switching from remote Docker interpreter to local interpreter solved the problem.
For Linux and OSX
Step 1: Download chromedriver
# You can find more recent/older versions at http://chromedriver.storage.googleapis.com/
# Also make sure to pick the right driver, based on your Operating System
wget http://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_mac64.zip
For debian: wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
Step 2: Add chromedriver to /usr/local/bin
unzip chromedriver_mac64.zip
sudo mv chromedriver /usr/local/bin
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod +x /usr/local/bin/chromedriver
You should now be able to run
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://localhost:8000')
without any issues
Best way for sure is here:
Download and unzip chromedriver and put 'chromedriver.exe' in C:\Python27\Scripts and then you need not to provide the path of driver, just
driver= webdriver.Chrome()
You are done no need to add paths or anything