2

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

  • MacOS Catalina
  • Python 3.7.6 (Anaconda)
  • Selenium 3.141
  • Chrome v81, ChromeDriver v81.

    Error: Can not connect to the service chromedriver.

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.

4
  • Have you tried to do this? github.com/SeleniumHQ/selenium/issues/… Commented May 13, 2020 at 15:05
  • I have tried that, it focused on localhost address in the hosts file. It didn't do anything, everything was already the way it was supposed to be. @Naveen Commented May 13, 2020 at 15:10
  • Can you try to initiate Chrome as per this answer stackoverflow.com/a/39428368/7964299? Commented May 13, 2020 at 16:00
  • I tried that, it didn't work. The error remained the same. @Naveen Commented May 15, 2020 at 20:55

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.