I am trying to run a script (Python3.5), but get the error 'chromedriver' executable needs to be in PATH. I know I can change the PATH variable, but I wanted to use an absolute path. I went to the documentation https://sites.google.com/a/chromium.org/chromedriver/getting-started
The code example they used:
import time
from selenium import webdriver
driver = webdriver.Chrome('/path/to/chromedriver') #Optional argument, if not specified will search path.
My code:
#!/usr/bin/env python3.5
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
driver=webdriver.Chrome(
"/home/ubuntu/Downloads/chromedriver")
driver.get('https://python.org')
print (driver.title)
Any suggestions for why the absolute path is not working?
Solved the issue. I needed to added: executable_path, so driver = webdriver.Chrome(executable_path="home/ubuntu/Downloads/chromedriver") and now it runs fine.