我最近将我的 mac 机器升级到 OS Catalina(v 10.15.3)。升级后,我无法使用 selenium 启动 chrome 驱动程序。
当我运行 selenium 代码来启动 chrome 浏览器时,我面临以下错误。
“无法打开“chromedriver”,因为无法验证开发人员”。“macOS 无法验证此应用程序是否没有恶意软件。”
请帮我!
我的问题几乎就在标题中.
例如,在使用Rails 3.1应用程序创建的默认Gemfile中;
gem 'sass-rails', '~> 3.1.5'
Run Code Online (Sandbox Code Playgroud)
好像我应该知道这一点,但我在Bundler网站上找不到任何引用.
环境:
\n操作系统:Big Sur 11.1
\nHomebrew 3.2.13
\nPython 3.9.7
命令:
\nchromedriver \xe2\x80\x94version
尝试运行 chromedriver 的 .py 文件输出出错:
\nraise WebDriverException(selenium.common.exceptions.WebDriverException: Message: Service /opt/homebrew/bin/chromedriver unexpectedly exited. Status code was: -9
如警报中所述,尝试更新 chromedriver:
\n卸载当前版本:
\nbrew uninstall chromedriver
验证 chromedriver 是否已卸载:
\nbrew info chromedriver
安装最新版本的 chromedriver:
\nbrew install chromedriver
您还可以尝试:
\nbrew reinstall chromedriver
如果您仍然遇到该问题,此修复对我有帮助。
\n确定正在使用哪个 chromedriver,运行:
\nwhich chromedriver …