WebDriverException:消息:无效参数:无法在RaspberryPi3上使用GeckoDriver,Selenium和Python终止已退出的进程
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了WebDriverException:消息:无效参数:无法在RaspberryPi3上使用GeckoDriver,Selenium和Python终止已退出的进程,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2570字,纯文字阅读大概需要4分钟。
内容图文
![WebDriverException:消息:无效参数:无法在RaspberryPi3上使用GeckoDriver,Selenium和Python终止已退出的进程](/upload/InfoBanner/zyjiaocheng/952/1884010797194173ab1a275e269cdf5e.jpg)
服务器:Raspberry Pi 3
操作系统:Dietpi – 版本159
Geckodriver版本:手臂0.22
Firefox版本:52.9.0
Python版本:3.5
Selenium版本:3.14.1
Gecko是可执行的,位于/usr/local/bin /
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.firefox.options import Options
import time
options = 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
知道什么是错的吗?我试过谷歌没有运气.
解决方法:
此错误消息…
selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process
…暗示GeckoDriver无法启动/生成新的WebBrowsing会话,即Firefox浏览器会话.
您的主要问题是您使用的二进制文件版本之间的不兼容性如下:
>您的GeckoDriver版本是0.22.0.
> GeckoDriver v0.21.0(2018-06-15)的发行说明明确提到以下内容:
>
Firefox 57 (and greater)
>
Selenium 3.11 (and greater)
>您的Firefox版本是52.9.0.
因此,GeckoDriver v0.22.0与Firefox浏览器v57之间存在明显的不匹配
解
>将GeckoDriver升级到GeckoDriver v0.22.0级别.
> GeckoDriver存在于指定位置.
> GeckoDriver拥有非root用户的可执行权限.
>将Firefox版本升级到Firefox v62.0.2级别.
>通过IDE清理Project Workspace,并仅使用所需的依赖项重建项目.
>如果您的基本Web客户端版本太旧,请通过Revo Uninstaller将其卸载并安装最新的GA和已发布的Web客户端版本.
>以非root用户身份执行Selenium Test.
内容总结
以上是互联网集市为您收集整理的WebDriverException:消息:无效参数:无法在RaspberryPi3上使用GeckoDriver,Selenium和Python终止已退出的进程全部内容,希望文章能够帮你解决WebDriverException:消息:无效参数:无法在RaspberryPi3上使用GeckoDriver,Selenium和Python终止已退出的进程所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。