为什么发生错误状态代码为:-4 Termux
我在termux中安装了ubuntu,想在那里的硒上运行一个机器人 为此,我通过PIP安装了Selenium,并从Githab下载了官方的Web驱动程序,并进行了测试的初始化,但它给了我错误
from selenium import webdriver
driver = webdriver.Firefox(executable_path='/root/firefox_driver/geckodriver')
错误
root@localhost:~# python3 test.py
test.py:5: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Firefox(executable_path='/root/firefox_driver/geckodriver')
Traceback (most recent call last):
File "test.py", line 5, in <module>
driver = webdriver.Firefox(executable_path='/root/firefox_driver/geckodriver')
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/firefox/webdriver.py", line 172, in __init__
self.service.start()
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service /root/firefox_driver/geckodriver unexpectedly exited. Status code was: -4
I installed ubuntu in termux and want to run a bot on selenium there
To do this, I installed Selenium via PIP and downloaded the official web driver from Githab and ran the initialization for the test but it gave me an error
from selenium import webdriver
driver = webdriver.Firefox(executable_path='/root/firefox_driver/geckodriver')
Error
root@localhost:~# python3 test.py
test.py:5: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Firefox(executable_path='/root/firefox_driver/geckodriver')
Traceback (most recent call last):
File "test.py", line 5, in <module>
driver = webdriver.Firefox(executable_path='/root/firefox_driver/geckodriver')
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/firefox/webdriver.py", line 172, in __init__
self.service.start()
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/common/service.py", line 98, in start
self.assert_process_still_running()
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service /root/firefox_driver/geckodriver unexpectedly exited. Status code was: -4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论