我最近把我的mac电脑升级到OS Catalina(v 10.15.3)。在这次升级之后,我无法使用硒启动chrome驱动程序。
当我运行selenium代码启动chrome浏览器时,我面临以下错误。
“chromedriver”无法打开,因为开发人员无法验证”。 “macOS无法验证此应用程序没有恶意软件。”
请帮帮我!
我最近把我的mac电脑升级到OS Catalina(v 10.15.3)。在这次升级之后,我无法使用硒启动chrome驱动程序。
当我运行selenium代码启动chrome浏览器时,我面临以下错误。
“chromedriver”无法打开,因为开发人员无法验证”。 “macOS无法验证此应用程序没有恶意软件。”
请帮帮我!
当前回答
在macOS Catalina和macOS Mojave中,当一个应用程序因为没有经过公证或来自未知开发者而无法安装时,它将出现在“常规”选项卡下的“系统首选项>安全与隐私”中。点击“无论如何打开”来确认你要打开或安装应用程序的意图。
再次弹出警告提示,单击“Open.*”
该应用程序现在被保存为安全设置的一个例外,将来你可以像打开任何授权应用程序一样双击打开它。
*如果提示打开Finder:在Finder中控制单击应用程序,从菜单中选择打开,然后在出现的对话框中单击打开。输入您的管理员名和密码打开应用程序。
其他回答
这是一个许可问题…… 升级chrome后,这个错误显示,所以我遵循下面提到的步骤,它在我的系统工作。
系统设置 安全与隐私 进入“常规”选项卡 允许从以下地方下载应用程序: 选择App Store和已识别的开发商 单击锁进行更改。 输入系统密码 点击“无论如何打开”来确认你要打开或安装应用程序的意图。
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).
Xattr -d com.apple.quarantine $(chromedriver)本身是不够的。
对于最新版本的chromedriver,似乎他们正在划分版本文件夹。 9月30日20日给我。对我有用的是xattr -d com.apple.quarantine 85.0.4183.87/chromedriver
打开终端,进入下载chromedriver的路径。 执行xattr -d com.apple.quarantine chromedriver
解决这个问题有两个步骤:
使用- cd /usr/local/bin命令进入该路径。这是你将看到你的chromedriver安装的地方。 当进入bin目录时,执行此命令- xattr -d com.apple.quarantine chromedriver。
就这些。这对我来说很管用。