服务器:Raspberry Pi 3
操作系统:Dietpi-版本159
Geckodriver版本:手臂0.22
Firefox版本:52.9.0
Python版本:3.5
硒版本: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 无法启动/产生新的 Web浏览会话,即 Firefox浏览器会话。
您的主要问题是正在使用的二进制版本之间的不兼容,如下所示:
GeckoDriver v0.21.0的
因此,GeckoDriver v0.22.0和Firefox Browser v57之间存在明显的不匹配
解
GeckoDriver, Selenium and Firefox Browser compatibility chart
Selenium:WebDriverException:Chrome无法启动:由于google-chrome不再运行而崩溃,因此ChromeDriver认为Chrome已崩溃 - python
最近,我更换了计算机,从那时起,我无法使用硒启动铬。我也尝试过Firefox,但浏览器实例无法启动。from selenium import webdriver d = webdriver.Chrome('/home/PycharmProjects/chromedriver') d.get('https://www.google…
Selenium Chromedriver Python-使用Tor代理加载ModHeader扩展时,“无法等待扩展背景页面加载” - python该错误是在以前运行正常的程序中无处发生的。绝对可以肯定的是,由于它的功能完善,因此我没有对程序进行任何更改,因此这是迄今为止我所遇到的最奇怪,最令人沮丧的错误。这是我要执行的代码:chrome_options.add_extension('C:\\chromedriver\\ModHeader_v (1).crx') chrome_opt…
Python GPU资源利用 - python我有一个Python脚本在某些深度学习模型上运行推理。有什么办法可以找出GPU资源的利用率水平?例如,使用着色器,float16乘法器等。我似乎在网上找不到太多有关这些GPU资源的文档。谢谢! 参考方案 您可以尝试在像Renderdoc这样的GPU分析器中运行pyxthon应用程序。它将分析您的跑步情况。您将能够获得有关已使用资源,已用缓冲区,不同渲染状态上…
Python + Selenium:我无法从div获取打印文本 - pythonPython + Selenium:我无法从此div获取打印文本:<div id="modal-content-18" class="modal-content" data-role="content"> <div> SignUp Failed. Please Try Aga…
Selenium with Python:从具有只读功能的表单中收集电子邮件 - python我正在尝试从内部具有只读内容的网站上的表单收集电子邮件地址。<input name="email" id="email" type="text" class="form-control" value="[email protected]" readonl…