Python Selenium ChromeDriver not available

So I cannot figure out why I am getting this exception. When I only run the chrome recorder I get:

Running ChromeDriver 2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3) on port 9515

When I try to run it from a file, I get:

WebDriverException: Message: chrome not reachable (Driver information: chromedriver = 2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3), platform = Linux 3.13.0-52-generic x86_64)

Code:

if self.proxy:
    chrome_options = Options()
    chrome_options.add_argument("--proxy-server=http://user:password@proxy.com:8080")
    self.webdriver = webdriver.Chrome('/usr/bin/google-chrome', chrome_options=chrome_options)
else:
    self.webdriver = webdriver.Chrome('/usr/bin/google-chrome')

      

I am running it without proxy. If I don't put in the path, it won't be able to find the chrome binary for some reason. I don’t know where to go.

+3


source to share


2 answers


The path that needs to be given in the first positional or executable_path

keyword argument
is the path to the chromograph, not chrome :

self.webdriver = webdriver.Chrome('/path/to/chromedriver', chrome_options=chrome_options)

      



If it chromedriver

is in $PATH

- you don't need to specify the path at all - it usually is.

0


source


download chrome driver and use this code



driver = webdriver.Chrome("C:\\chromedriver.exe")

      

0


source







All Articles