python virtualenv中用于硒的Chrome Web驱动程序错误

时间:2019-01-10 04:09:27

标签: python selenium

我不明白我在做什么错。有人可以帮忙吗?尝试使用树莓派和Raspbian打开一个简单的网站

#!/home/pi/Documents/Tiller/bin python2

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome("/home/pi/Documents/Tiller/bin/webdriver")
driver.get("www.tillerhq.com")
driver.quit()

这是我得到的错误

Traceback (most recent call last):
  File "Tiller.py", line 6, in <module>
    driver = webdriver.Chrome("/home/pi/Documents/Tiller/bin/webdriver")
  File "/home/pi/Documents/Tiller/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/home/pi/Documents/Tiller/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error

1 个答案:

答案 0 :(得分:0)

请确保使用针对正确架构(可能是https://launchpad.net/ubuntu/trusty/armhf/chromium-chromedriver/65.0.3325.181-0ubuntu0.14.04.1的情况)编译的chromedriver。

该错误似乎是您尝试运行的操作系统未编译的二进制文件。