[英]Quickstart.py failed to run due to selenium issue
I cannot find anywhere solution to my issue. 我找不到任何解决我问题的方法。
I have installed Instapy successfully in Amazon lightsail Ubuntu 18.04.3 LTS Linux. 我已在Amazon Lightail Ubuntu 18.04.3 LTS Linux中成功安装了Instapy。 Thank you so much for any suggestion.
非常感谢您的任何建议。
When I tried to run the simple test script below. 当我尝试运行下面的简单测试脚本时。
I get as part of the error -> selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities 作为错误的一部分,我得到了-> 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)
I get the following error... 我收到以下错误...
I can identify 2 potential errors 我可以找出2个潜在的错误
File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) 执行self.error_handler.check_response(response)中的文件“ /usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py”,第321行
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities selenium.common.exceptions.SessionNotCreatedException:消息:找不到匹配的功能集
I think the errors has to be related to selenium and Firefox browser , as the error is prompted while trying to run the browser in the background (headless_browser=True) 我认为错误必须与selenium和Firefox浏览器有关,因为尝试在后台运行浏览器时会提示错误(headless_browser = True)
See full error message below 请参阅下面的完整错误消息
._. ._. ._. ._. ._. ._. ._. ._.
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
Thanks for your help! 谢谢你的帮助!
I had the same issue today, then realized the second File call was referencing Firefox. 今天我遇到了同样的问题,然后意识到第二个File调用是引用Firefox。 So, I loaded Firefox on the server and things worked perfectly.
因此,我在服务器上加载了Firefox,一切运行正常。 Not sure how the "Quickstart" missed this...
不确定“快速入门”如何错过了这个...
Found out how to do that here: https://vitux.com/4-ways-to-install-mozilla-firefox-in-ubuntu/ 在这里找到如何执行此操作: https : //vitux.com/4-ways-to-install-mozilla-firefox-in-ubuntu/
Method 2: From the Official Ubuntu Repository-through the Command Line
方法2:通过命令行从官方Ubuntu存储库
$ sudo apt-get update
$ sudo apt install firefox
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.