MacOS Catalina(v 10.15.3): Error: “chromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser

后端 未结 9 508
萌比男神i
萌比男神i 2021-01-29 20:14

I have recently upgraded my mac machine to OS Catalina(v 10.15.3). After this upgrade I am unable to launch the chrome driver using selenium.

I am facing the below error

相关标签:
9条回答
  • 2021-01-29 21:01

    In macOS Catalina and macOS Mojave, when an app fails to install because it hasn’t been notarized or is from an unidentified developer, it will appear in System Preferences > Security & Privacy, under the General tab. Click Open Anyway to confirm your intent to open or install the app.

    The warning prompt reappears, and you can click Open.*

    The app is now saved as an exception to your security settings, and you can open it in the future by double-clicking it, just as you can any authorized app.

    *If you're prompted to open Finder: control-click the app in Finder, choose Open from the menu, and then click Open in the dialog that appears. Enter your admin name and password to open the app.

    0 讨论(0)
  • 2021-01-29 21:03

    xattr -d com.apple.quarantine $(which chromedriver) alone is not enough.

    with the lastest version of chromedriver, it seem like they are dividing into version folders.
    for me on 9/30/20. what worked for me is xattr -d com.apple.quarantine 85.0.4183.87/chromedriver

    0 讨论(0)
  • 2021-01-29 21:04

    Two steps to solve this:

    1. Navigate to the path using command- "cd /usr/local/bin". This is where you will see your chromedriver installed.
    2. When inside the bin directory, run this command- "xattr -d com.apple.quarantine chromedriver".

    And that's all. It worked for me like that.

    0 讨论(0)
  • 2021-01-29 21:09

    The above answers were helpful. I would just add that if you're running Selenium from a development environment, in my case a Jupyter Notebook, and this is the issue, you're likely to see a PermissionError: [Errno 13] Permission denied error. There are other causes for this error, but it can be that macOS Catalina is blocking chromedriver from running for security reasons. Following the approaches above, I ran it from the command line and then was able to open it from Jupyter using driver = webdriver.Chrome('path/to/chromedriver).

    0 讨论(0)
  • 2021-01-29 21:10

    (What worked for me, hopefully works for you too)

    Update for all the macOS Big Sur 11.0 users:

    1. use homebrew to install chromedriver

      brew install chromedriver

    2. navigate to chromedriver that is in the Caskroom folder specifically

      /usr/local/bin/Caskroom/chromedriver ... keep going until you see the Unix Executable File called "chromedriver"

    3. following Apple's recommendation for opening Mac apps from unidentified developer, double-click chromedriver, and then click "Open"

    For me, this resulted in a terminal window popping up with the output:

    
    Starting ChromeDriver ...
    Only local connections are allowed.
    Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
    ChromeDriver was started successfully.
    

    I can now run scrapy-selenium no problem, you can close the terminal window (yes, terminate the process is OK) and it should still work without stopping you now.

    Let me know if this works for you

    0 讨论(0)
  • 2021-01-29 21:14

    Quick solution

    1. Open Finder
    2. Navigate to where the chromedriver file is located
    3. Right-click on the chromedriver file and select open

    After this the script should work fine.

    0 讨论(0)
提交回复
热议问题