簡體   English   中英

Python Selenium chromedriver OSError:[Errno 8] Exec格式錯誤

[英]Python Selenium chromedriver OSError: [Errno 8] Exec format error

我正試圖在我的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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM