Selenium/Raspberry Pi 3-无法找到匹配的功能集 [英] Selenium / Raspberry Pi 3 - Unable to find a matching set of capabilities

查看:95
本文介绍了Selenium/Raspberry Pi 3-无法找到匹配的功能集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Raspberry Pi上运行Python 3脚本并对其进行处理.该脚本可以在Mac上正常运行,但是我希望它可以24/7运行,并且Pi更加节能.更不用说我需要Mac来做其他事情.

I want to run a Python 3 script on my Raspberry Pi and do stuff with it. The script works just fine on my Mac, however I want it to run 24/7 and the Pi is more energy efficient. Not to mention I need my Mac for other things.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
browser = webdriver.Firefox()
browser.get('www.website.com')

我正在运行Raspbian Jesse,并安装了Iceweasel(今天通过命令行V 45安装)和geckodriver(0.18.0).

I am running Raspbian Jesse and have installed Iceweasel (installed today through command line, V 45) and geckodriver (0.18.0).

运行脚本会引发以下错误:

Running the script throws the following error:

selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities

想法?

干杯.

推荐答案

尝试更新到最新的Selenium,Firefox和geckodriver.

Try updating to the latest Selenium, Firefox, and geckodriver.

Firefox:

sudo apt-get install firefox-esr --upgrade

硒:

pip install selenium --upgrade

Mozilla不再发布arm7 geckodriver二进制文件,但是有说明从另一个平台为arm7对其进行交叉编译此处和常规构建说明这里.第一步是下载源代码:

Mozilla no longer publishes arm7 geckodriver binaries, but there are instructions to crosscompile it for arm7 from another platform here and regular building instructions here. The first step is downloading the source:

curl https://hg.mozilla.org/mozilla-central/archive/tip.zip/testing/ > testing.zip
unzip testing.zip

如果v26足够,我已经为arm7进行了编译此处: https://github.com/Tahlor/geckodriver

Or if v26 is sufficient, I've compiled it for arm7 here: https://github.com/Tahlor/geckodriver

这篇关于Selenium/Raspberry Pi 3-无法找到匹配的功能集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆