[英]selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: -11 - How to fix?
I want to setup https://github.com/mukulhase/WebWhatsapp-Wrapper on my Raspberry Pi Zero W. I used this ( https://www.raspberrypi.org/forums/viewtopic.php?t=167292#p1246095 ) as "tutorial" for installing Gecko Driver. 我想在我的Raspberry Pi Zero W上设置https://github.com/mukulhase/WebWhatsapp-Wrapper 。我使用了它( https://www.raspberrypi.org/forums/viewtopic.php?t=167292#p1246095 )作为安装Gecko驱动程序的“教程”。 Instead of
代替
curl -O {link}
I used 我用了
wget {link}
because 因为
tar -xzvf {file}
didn't work for me. 没有为我工作。
At the moment when I wanted to open Firefox (you can see below in my code) it fails. 当我想打开Firefox时(您可以在下面的代码中看到),它失败了。 I hope anybody could help me.
我希望有人能帮助我。
I tried to use another version of geckodriver but it didn't work, too. 我尝试使用其他版本的geckodriver,但也无法正常工作。
>>> from selenium import webdriver
>>> browser = webdriver.Firefox()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
self.service.start()
File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: -11
有人发现RasPi Zero使用arm6hf,但我将geckodriver用于arm7hf。
This error message... 此错误消息...
selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: -11
...implies that the subprocess exited
and Status code was: -11 ...表示该子进程
exited
并且状态代码为:-11
You need to download the latest matching geckodriver from Releases · mozilla/geckodriver . 您需要从下载最新的匹配geckodriver 发布的mozilla·/ geckodriver 。
As you are on Raspberry Pi Zero W you need to download geckodriver-v0.23.0-arm7hf.tar.gz
and save it within your system. 在使用Raspberry Pi Zero W时,您需要下载
geckodriver-v0.23.0-arm7hf.tar.gz
并将其保存在系统中。 Additionally, you need to mention the absolute path of the geckodriver binary passing the argument executable_path
as follows: 此外,您需要提及geckodriver二进制
executable_path
的绝对路径 ,并通过以下参数传递了execute_path 参数 :
from selenium import webdriver
driver = webdriver.Firefox(executable_path='/path/to/geckodriver')
driver.get("http://google.com/")
driver.quit()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.