首页 > 解决方案 > Raspberry Debian 在启动时运行失败,但 manuel 运行完美

问题描述

启动时运行失败,但脚本在 manuel 上运行良好。所以这个问题不是重复的我试图用覆盆子自动化一个 instapy 脚本,但是当我尝试在启动时运行选项时,它们都失败并显示错误代码;

  InstaPy Version: 0.6.9
  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
  Workspace in use: "/root/InstaPy"
  Traceback (most recent call last):
  File "/home/pi/Desktop/VersusInstaBot.py", line 15, in <module>
split_db=False)
  File "/usr/local/lib/python3.7/dist-packages/instapy/instapy.py", line 322, in __init__
self.logger,

  File "/usr/local/lib/python3.7/dist-packages/instapy/browser.py", line 125, in 
  set_selenium_local_session
  options=firefox_options,
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
keep_alive=True)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
 File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

它在手动启动时运行良好,但无论我使用哪种方法在启动时运行,此代码都会失败。systemd、autostart、rc.local 甚至 bash 都因这一行而失败。所以我相信这与剧本本身无关。关于覆盆子尝试在启动时运行它的方式

我意识到 InstaPy 尝试将工作区设置为 /root/InstaPy 我不知道这是否重要,但我试图强制它将工作区设置为默认路径仍然没有任何变化

顺便说一下 split_db = False 代码,我是否将其更改为 True 或 False 或完全删除代码都没有关系

标签: pythonseleniumfirefoxinstapy

解决方案


推荐阅读