【问题标题】:OSError: [Errno 8] Exec format error when trying to run chromedriver for seleniumOSError: [Errno 8] 尝试运行 chromedriver for selenium 时执行格式错误
【发布时间】:2016-12-31 14:00:09
【问题描述】:

我正在尝试在 Jenkins 的基于 Ubuntu 的服务器上运行基于 Selenium 的测试,但出现以下神秘错误:

第一:

+ python manage.py jenkins --enable-coverage --settings=Modeling.settings.dev
......EException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b67b3ac50>> ignored
EException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b2ed10>> ignored
EEException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b4bad0>> ignored
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66ad5a90>> ignored
EException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66ae3110>> ignored
EEException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66af06d0>> ignored
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66af12d0>> ignored
EException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66af1ad0>> ignored
EEException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b03ad0>> ignored
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b08f50>> ignored
EEEException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b08790>> ignored
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b08d50>> ignored
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b0bbd0>> ignored
EEException AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66a95a10>> ignored
Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x7f6b66b08550>> ignored

然后再往下一点:

Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/GS_modelling_web_tests/workspace/modeling/Modeling/tests/BaseTest.py", line 18, in setUp
    self.browser = webdriver.Chrome( ChromeDriver.path() )
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 61, in __init__
    self.service.start()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", line 62, in start
    stdout=self.log_file, stderr=self.log_file)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

对于我看到的第一个错误Scrapy with selenium, webdriver failing to instantiate,但这似乎与关闭有关?根据OSError: [Errno 8] Exec format error,第二个错误似乎与shebangs有关,但我无法理解我是否可以使用该信息。这是怎么回事?

【问题讨论】:

  • 我有一个类似的错误,我有posted here。感谢您的帮助!

标签: python selenium jenkins


【解决方案1】:

OSError: [Errno 8] 执行格式错误

Ubuntu 平台不支持此处提供的 ChromeDriver 可执行文件。 对于 Ubuntu,使用 chromedriver for ubuntu http://chromedriver.storage.googleapis.com/2.23/chromedriver_linux32.ziphttp://chromedriver.storage.googleapis.com/2.23/chromedriver_linux64.zip

完整列表可以在https://sites.google.com/a/chromium.org/chromedriver/downloads找到

【讨论】:

    猜你喜欢
    • 2016-07-08
    • 2018-12-30
    • 2015-02-20
    • 2019-08-14
    • 2019-05-24
    • 2016-12-14
    • 1970-01-01
    • 2015-01-04
    • 1970-01-01
    相关资源
    最近更新 更多