【发布时间】:2019-07-16 18:03:02
【问题描述】:
我有以下配置:
-
Raspberry Pi2拉伸-
Python 2.7已安装 pip -
Firefox 52.9.0(来自 apt-get install firefox-esr) -
geckodriver 0.17.0(来自https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-arm7hf.tar.gz),复制到/usr/local/bin -
Selenium 3.4.0
-
所以根据https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/Support.html,这应该可行。 但是,运行这个简单的 python 脚本:
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(1024, 768))
display.start()
driver = webdriver.Firefox()
driver.get('http://www.google.com/')
print browser.title
driver.quit()
display.stop()
返回错误:
服务 geckodriver 意外退出。状态码是:-11
我尝试了很多方法,例如将 Selenium/geckodriver 更新到最新版本,尝试了介于两者之间的一些版本(Selenium 3.0.2、Geckodriver 0.11.1,如 Selenium Firefox webdriver results in error: Service geckodriver unexpectedly exited. Status code was: 2 所述),但仍然出现相同的错误 -11(崩溃)。
任何想法或工作配置? 谢谢, 让
【问题讨论】:
-
有趣...在我尝试运行 geckodriver (./geckodriver) 的地方,无论我使用什么版本,都会遇到分段错误或非法指令。没看懂,怎么回事?
标签: python raspberry-pi2 geckodriver selenium-firefoxdriver stretch