我试图在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寻找其他问题,一个常见的问题似乎是色度驱动器没有在道路上,但我检查了,它是。我甚至尝试显式地指定路径:
driver=webdriver.Chrome("/path/to/chromedriver")结果是一样的。有人知道问题出在哪里吗?我真的很感激你的帮助!
发布于 2016-03-28 20:30:34
我最终解决了这个问题,卸载了所有chromedriver实例(我在不同的位置有多个实例),然后用brew install chromedriver重新安装它。
https://stackoverflow.com/questions/36141032
复制相似问题