【问题标题】:Instapy issue, probbably connected to firefox webdriverInstapy 问题,可能连接到 firefox webdriver
【发布时间】:2021-06-29 12:15:23
【问题描述】:

这是我的代码:

from instapy import InstaPy

session = InstaPy(username="<my_username>", password="<my_password>")
session.login()
session.like_by_tags(["bmw", "mercedes"], amount=5)

它会返回一条错误消息:

InstaPy Version: 0.6.13
 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "C:/Users/budim/InstaPy"

  0%|          | 0/1407 [00:00<?, ?kb/s]
 28%|██▊       | 387/1407 [00:00<00:00, 3774.35kb/s]
 54%|█████▍    | 765/1407 [00:00<00:00, 3257.82kb/s]
 78%|███████▊  | 1095/1407 [00:00<00:00, 2863.47kb/s]
 99%|█████████▊| 1387/1407 [00:00<00:00, 2687.05kb/s]
1408kb [00:00, 2887.22kb/s]                          
Traceback (most recent call last):
  File "C:\Users\budim\Desktop\natjecanje iz inf\test.py", line 3, in <module>
    session = InstaPy(username="<my_username>", password="<my_password>")
  File "C:\Users\budim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\instapy\instapy.py", line 325, in __init__
    self.browser, err_msg = set_selenium_local_session(
  File "C:\Users\budim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\instapy\browser.py", line 123, in set_selenium_local_session
    browser = webdriver.Firefox(
  File "C:\Users\budim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\budim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\budim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\budim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\budim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

[Finished in 6.2s]

我不明白为什么会这样。如果有人可以提供一些帮助,我将非常感激。

【问题讨论】:

  • 你的系统中安装了firefox吗?

标签: python firefox webdriver instapy


【解决方案1】:

不是instapy的问题,是firefox的问题

selenium.common.exceptions.SessionNotCreatedException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line 

GeckoDriver(firefox 网络驱动程序)无法在默认位置找到 Firefox 二进制文件。

expected-browser-binary-location-but-unable-to-find-binary-in-default-location

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-02
    • 2017-07-08
    • 2013-03-26
    相关资源
    最近更新 更多