1

嘿,每个人我都在尝试编写一个 instabot 并且刚刚开始,但是从一开始我就无法让它工作,每次我尝试运行我的快速入门时都会出现这个问题,它给了我这个错误:

InstaPy Version: 0.6.10
 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.
Workspace in use: "C:/Users/Floris/InstaPy"
Traceback (most recent call last):
  File "c:/Users/Floris/Desktop/instabot/quickstart.py", line 12, in <module>
    session = InstaPy(username=insta_username,
  File "C:\Users\Floris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\instapy\instapy.py", line 312, in __init__
    self.browser, err_msg = set_selenium_local_session(
  File "C:\Users\Floris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\instapy\browser.py", line 121, in set_selenium_local_session
    browser = webdriver.Firefox(
  File "C:\Users\Floris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\Floris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\Floris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\Floris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Floris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-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

我安装了 InstaPy 从快速入门运行安装和更新 这是我的代码

# imports
from instapy import InstaPy
from instapy import smart_run

insta_username = ''
insta_password = ''


# get an InstaPy session!
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False)

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

它不是那么先进,因为我只是想让它开始

我希望你能帮帮我

4

1 回答 1

0

如果您还没有 firefox 和 geckodriver,您应该安装它们....也就是说,如果您已经有 geckodriver,请尝试将 geckodriver_path 参数添加到 InstaPy

 session = InstaPy(username="Your username", password="your password", geckodriver_path= r"C:\Users\REPLACE\REPLACE\REPLACE\geckodriver.exe")
于 2020-09-29T11:05:32.710 回答