Python Selenium chromedriver OSError:[Errno 8] Exec格式错误

我正试图在我的python(2.7)脚本中设置与Selenium的chrome会话,如下所示:

from selenium import webdriver
driver=webdriver.Chrome()

但是我收到以下错误

Traceback (most recent call last):
File "soup_test.py", line 30, in <module>
driver=webdriver.Chrome()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 61, in __init__
self.service.start()
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 62, in start
stdout=self.log_file, stderr=self.log_file)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error

通过其他问题搜索一个常见的问题似乎是chromedriver不在路上,但我检查了它.我甚至尝试明确指定路径:

driver=webdriver.Chrome("/path/to/chromedriver")

结果相同.任何人都知道可能是什么问题?我非常感谢你的帮助!

解决方法:

我最终解决了这个问题,卸载了chromedriver的所有实例(我在不同的位置有多个)然后再用homebrew安装它:brew install chromedriver

相关文章

转载地址:https://www.cnblogs.com/mini-monkey/p/12104821...
web自动化测试过程中页面截图相对比较简单,可以直接使用sel...
目录前言一、Selenium简介二、浏览器驱动1.浏览器驱动参考2....
一、iframe的含义:iframe是HTML中框架的一种形式,在对界面...
转载请注明出处❤️作者:测试蔡坨坨原文链接:caituotuo.to...
'''##**认识selenium**​**下载:pipinstall...