17

Environment:
OS : Big Sur 11.1
Homebrew 3.2.13
Python 3.9.7

Command:
chromedriver —version

Error GUI Alert:
enter image description here

Error via output of .py file attempt to run chromedriver:
raise WebDriverException(selenium.common.exceptions.WebDriverException: Message: Service /opt/homebrew/bin/chromedriver unexpectedly exited. Status code was: -9


Fix Method (1)

As stated in the alert, try updating chromedriver:

Uninstall the current version:
brew uninstall chromedriver

Verify that chromedriver is uninstalled:
brew info chromedriver

Install the newest version of chromedriver:
brew install chromedriver

You can also try:
brew reinstall chromedriver

Fix Method (2) : Still Stuck

If you are still experiencing the issue, this fix helped me.

Determine which chromedriver is being used, run:
which chromedriver

Result :
/opt/homebrew/bin/chromedriver

Use the path to chromedriver in the following command to unblock it.
xattr -d com.apple.quarantine /opt/homebrew/bin/chromedriver

Now run the following:
chromedriver —version

Result : ChromeDriver 93.0.4577.63

Chromedriver should successfully execute.

Reference
coorasse's answer.

demouser123
  • 4,108
  • 9
  • 50
  • 82
MikeySherm
  • 327
  • 4
  • 9
  • Try answers given here - https://stackoverflow.com/questions/60362018/macos-catalinav-10-15-3-error-chromedriver-cannot-be-opened-because-the-de – demouser123 Sep 24 '21 at 13:57

3 Answers3

9

For downloading from the chrome drive website this one worked for me for MAC m1 chip

Use the path to chromedriver in the following command to unblock it.

xattr -d com.apple.quarantine path/to/chromedrive
omar esam
  • 91
  • 1
  • 5
3

I had the same issue this morning, this is what fixed it for me.

  1. Go to the system and preferences -> security and privacy.
  2. Then under general tab you will see a notification that about the exec you are trying to open.
  3. Just click "open anyway" there.
  4. Go back to the chromedriver exe and open it it will then give you the same error but along with that you will get an option to open it.
  5. Click Open and it should resolve.

Worked for me.

Nehra An
  • 51
  • 7
0

I use this thing in tests:

driver = webdriver.Chrome(ChromeDriverManager().install())

It installs driver even if you don't have one here:

/Users/ME/.wdm/drivers/chromedriver/mac_arm64/112.0.5615/chromedriver

But when I used this command to install driver:

brew install chromedriver

It had been installed here:

/opt/homebrew/bin/chromedriver

So I've got two chromedrivers on my mac. All that i had to do is manually remove these two and then just launch my tests. It worked

iZhitin
  • 1
  • 1