MAC下运行Python3+selenium+chrome遇到的问题解决方案

1.调用webdriver.chrome(),打开浏览器,出现“您使用的不受支持的命令行标记:-extensions-on-chrome-urls。稳定性和安全性有所下降”

MAC下运行Python3+selenium+chrome遇到的问题解决方案_第1张图片

加入下面一段代码,可解决:

options = webdriver.ChromeOptions()

options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])

browser = webdriver.Chrome(chrome_options=options)

2.打开chrome后,执行get("https://www.baidu.com")报错

MAC下运行Python3+selenium+chrome遇到的问题解决方案_第2张图片

原因:我安装的chromedriver为32位的,重新下载64位chromedriver的即可解决,下载地址:https://sites.google.com/a/chromium.org/chromedriver/downloads。

你可能感兴趣的:(MAC下运行Python3+selenium+chrome遇到的问题解决方案)