Geckodriver 和 Firefox 在 Raspberry Pi 3 上兼容吗?
Are Geckodriver and Firefox compatible on Raspberry Pi 3?
我正在尝试安装一个在我的 Raspberry Pi 3.
上进行网页抓取的小程序
该程序在我的 Ubuntu 16.04 笔记本电脑上运行良好。我知道它在我的 Raspberry Pi 3 上不起作用的原因与 Geckodriver 和 Firefox-ESR 之间的兼容性问题有关。我正在为两者使用最新版本。
是否有可以工作的 Geckodriver 和 Firefox 的存储库版本组合?
是否有浏览器和 webdriver 的替代组合可以在 Raspberry Pi 3 上使用 selenium 进行网络抓取?
非常感谢您的反馈!
环境
- 操作系统:Raspbian GNU/Linux 9(拉伸)内核:Linux
4.9.59-v7+
- ARMv7 处理器版本 4 (v7l)
- Python 2.7.13
- 硒 3.10.0
- Firefox ESR 52.6.0(32 位)
- 壁虎驱动程序 0.19.1
输入
import os
import sys
import time
import selenium
# The BeautifulSoup module
from bs4 import BeautifulSoup
# The selenium module
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
# Using Firefox normally (browser pops up)
driver = webdriver.Firefox()
此时 Firefox window 打开并保持空白。一段时间后 python 在控制台
中给出以下输出
输出:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 162, in __init__
keep_alive=True)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: connection refused
根据我上面的问题,我开始安装以前的 geckodriver 版本,希望找到一个与 Firefox ESR 52.6.0(32 位)兼容的版本。
令我惊讶的是,geckodriver 0.16.1 与 Firefox ESR 52.6.0(32 位) 配合得很好!!!
我花了很多时间试图解决这个问题...我希望它能帮助处于同样情况的人!!
:)
我现在唯一的问题是 Firefox 无法正常工作。我想知道这是否与我使用的是旧版本的 geckodriver 有关...但是,那是另一个问题!
raspberry pi 3 目前只支持selenium 2.53.5
我正在尝试安装一个在我的 Raspberry Pi 3.
上进行网页抓取的小程序该程序在我的 Ubuntu 16.04 笔记本电脑上运行良好。我知道它在我的 Raspberry Pi 3 上不起作用的原因与 Geckodriver 和 Firefox-ESR 之间的兼容性问题有关。我正在为两者使用最新版本。
是否有可以工作的 Geckodriver 和 Firefox 的存储库版本组合?
是否有浏览器和 webdriver 的替代组合可以在 Raspberry Pi 3 上使用 selenium 进行网络抓取?
非常感谢您的反馈!
环境
- 操作系统:Raspbian GNU/Linux 9(拉伸)内核:Linux 4.9.59-v7+
- ARMv7 处理器版本 4 (v7l)
- Python 2.7.13
- 硒 3.10.0
- Firefox ESR 52.6.0(32 位)
- 壁虎驱动程序 0.19.1
输入
import os
import sys
import time
import selenium
# The BeautifulSoup module
from bs4 import BeautifulSoup
# The selenium module
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
# Using Firefox normally (browser pops up)
driver = webdriver.Firefox()
此时 Firefox window 打开并保持空白。一段时间后 python 在控制台
中给出以下输出输出:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 162, in __init__
keep_alive=True)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: connection refused
根据我上面的问题,我开始安装以前的 geckodriver 版本,希望找到一个与 Firefox ESR 52.6.0(32 位)兼容的版本。
令我惊讶的是,geckodriver 0.16.1 与 Firefox ESR 52.6.0(32 位) 配合得很好!!!
我花了很多时间试图解决这个问题...我希望它能帮助处于同样情况的人!!
:)
我现在唯一的问题是 Firefox 无法正常工作。我想知道这是否与我使用的是旧版本的 geckodriver 有关...但是,那是另一个问题!
raspberry pi 3 目前只支持selenium 2.53.5