Shivam Ralli
Shivam Ralli

Reputation: 31

Webdrivers not working with Selenium (Python)

I have tried various SO solutions on going about this. System Config:

I have tried the same with various driver and browers: Gecko/Firefox(Fresh install), Safaridriver/Safar - all with the same error.

The chromedriver, geckodriver are in PATH as well as usr/local/bin.

Code to reproduce:

from selenium import webdriver
chromedriver = '/usr/local/bin/chromedriver'
driver = webdriver.Chrome(chromedriver)

I have also tried various solutions, executable_path=chromedriver and hosts file with localhost 127.0.0.1 entry.

chromedriver by itself runs perfectly, without any issues, it just can't seem to connect to Selenium.

Any help, if possible will be appreciated.

Expected results: Selenium connects to driver

Actual Results: raise WebDriverException("Can not connect to the Service %s" % self.path) selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /usr/local/bin/chromedriver

Solutions already tried:

And other solutions on SO.

Upvotes: 2

Views: 732

Answers (1)

Shivam Ralli
Shivam Ralli

Reputation: 31

While experimenting to make this work, I somehow messed up while creating venv and docker images. Python as a whole got corrupted, along with chrome drivers. Had to reset the system.

That somehow has solved my problem with selenium. If anyone else finds the answer to this bug, be sure to drop your solution.

Until then, this was my update about how I got it working.

Upvotes: 1

Related Questions