为什么发生错误状态代码为:-4 Termux

发布于 2025-02-06 03:18:36 字数 1227 浏览 2 评论 0原文

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文