【问题标题】:Python Reddit API PRAW: ConnectionRefusedErrorPython Reddit API PRAW:ConnectionRefusedError
【发布时间】:2021-07-17 07:51:43
【问题描述】:

我正在使用 Reddit API 制作一个 python 机器人,以下是我的代码,为了安全起见,正在替换应用程序密码和 ID,但它们是正确的。

import praw

reddit = praw.Reddit(
    client_id="id",
    client_secret="secret",
    username='username',
    password='password',
    user_agent="python:com.example.myredditapp:v1.2.3 (by u/MattCodes2003)",
)

subreddit = reddit.subreddit('python')
hot_python = subreddit.hot(limit=5)

for submission in hot_python:
    print(submission)

但是当我运行代码时出现以下错误:

ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

我对这个错误感到很困惑,因为我一直遵循的教程和文档没有收到这个错误,任何帮助都会很棒!

【问题讨论】:

    标签: python reddit praw


    【解决方案1】:

    问题是我的身份验证错误,没有输入正确的密码。

    【讨论】:

      猜你喜欢
      • 2017-07-20
      • 2016-04-22
      • 2012-05-05
      • 2015-06-29
      • 1970-01-01
      • 2012-09-25
      • 2019-03-11
      • 1970-01-01
      • 2016-04-24
      相关资源
      最近更新 更多