为了账号安全,请及时绑定邮箱和手机立即绑定

WebDriverException:消息:无效参数:无法在RaspberryPi3

WebDriverException:消息:无效参数:无法在RaspberryPi3

慕标琳琳 2019-10-21 14:43:18
服务器:Raspberry Pi 3 操作系统:Dietpi-版本159 Geckodriver版本:用于手臂的0.22 Firefox版本:52.9.0 Python版本:3.5 Selenium版本:3.14.1Gecko是可执行文件,位于/ usr / local / bin /from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECfrom selenium.webdriver.firefox.options import Optionsimport timeoptions = Options()options.set_headless(headless=True)driver = webdriver.Firefox(firefox_options=options)print('Need your login credential')username = input('What is your username?:\n')password = input('What is your password?:\n')......输出:root@RPi3:~# python3.5 ITE-bot.py Traceback (most recent call last):  File "ITE-bot.py", line 12, in <module>    driver = webdriver.Firefox(firefox_options=options)  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__    keep_alive=True)  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__    self.start_session(capabilities, browser_profile)  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session    response = self.execute(Command.NEW_SESSION, parameters)  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute    self.error_handler.check_response(response)  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response    raise exception_class(message, screen, stacktrace)selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process知道有什么问题吗?我试过谷歌没有运气。
查看完整描述

3 回答

?
富国沪深

TA贡献1790条经验 获得超9个赞

是的,选中了在构建可以解决问题之前启动Xvfb,但是如果您有管道或多分支管道之类的工作,则此选项不可见。在执行测试的Selenium网格节点中,您需要:


1-安装Xvfb: apt install xvfb


2-执行Xvfb: /usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 & export DISPLAY=":99"


3-重新运行您的节点,例如: java -jar selenium.jar -role node -hub http://#.#.#.#:4444/grid/register -capabilities browserName=firefox,plataform=linux -host #.#.#.# -port 1991


查看完整回答
反对 回复 2019-10-21
  • 3 回答
  • 0 关注
  • 800 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信