Quickstart.py 由于硒问题而无法运行



我找不到任何解决我的问题的方法。

我已经在Amazon lightsail Ubuntu 18.04.3 LTS Linux中成功安装了Instapy。非常感谢您的任何建议。

当我尝试运行下面的简单测试脚本时。

我得到作为错误的一部分 -> selenium.common.exceptions.SessionNotCreatedException: 消息:无法找到一组匹配的功能

This is the script I am trying to run. Full Error is further below. 
# imports
from instapy import InstaPy
from instapy import smart_run

# login credentials -  password delete intentionally. 
insta_username = '******'
insta_password = '*****'
# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=True)

with smart_run(session):
# activity            
session.like_by_tags(["natgeo"], amount=10)

我收到以下错误...

我可以识别 2 个潜在错误

  1. 文件 "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py",第 321 行,在 execute self.error_handler.check_response(response(

  2. selenium.common.exceptions.SessionNotCreatedException: 消息:找不到一组匹配的功能

我认为错误必须与硒和Firefox浏览器有关,因为尝试在后台运行浏览器时会提示错误(headless_browser=True(

请参阅下面的完整错误消息

._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/home/ubuntu/InstaPy"
Traceback (most recent call last):
File "quickstart.py", line 25, in <module>
headless_browser=True)
File "/usr/local/lib/python3.6/dist-packages/instapy/instapy.py", line 318, in __init__
self.logger,
File "/usr/local/lib/python3.6/dist-packages/instapy/browser.py", line 114, in set_selenium_local_session
options=firefox_options,
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
keep_alive=True)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/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

感谢您的帮助!

我今天遇到了同样的问题,然后意识到第二个文件调用引用了Firefox。因此,我在服务器上加载了Firefox,并且运行良好。不知道"快速入门"是如何错过这个的...

在此处了解如何执行此操作: https://vitux.com/4-ways-to-install-mozilla-firefox-in-ubuntu/

方法2:从官方的Ubuntu仓库-通过命令行

$ sudo apt-get update
$ sudo apt install firefox

最新更新