python-3.x - 使用 PRAW 时出现 401 状态错误(reddit)
问题描述
import praw
import pandas as pd
reddit = praw.Reddit("bot1")
posts=[]
target_subreddit=reddit.subreddit("Python")
for post in target_subreddit.hot(limit=10):
posts.append([pos.title, post.score, post.url])
posts=pd.DataFrame(posts, columns=['title','score','url'])
posts.to_csv('result.csv', sep='\t', encoding='utf=8')
我已经使用名为 bot1 的 client_id、client_secret 和 user_agent 配置了 praw.ini 文件。在运行此代码时,我遇到了 prawcore.exceptions.ResponseException: received 401 HTTP error
谁能让我知道是什么问题?
解决方案
推荐阅读
- directus - 是否可以将无法删除/编辑的预定义集合添加到 Directus
- python - youtube api v3 返回的结果少于实体
- json - 根据匹配字段从另一个 JSON 文件添加或更新一个 JSON 文件中的字段
- python - 两条曲线 y_1 和 y_2 之间的填充区域不共享相同的 x
- c++ - 从文件中读取二维数组并将其传递给另一个函数
- python - 在 for 循环中取数据帧的交集
- graphql - GraphQLError:语法错误:预期名称,找到
- android - 数据绑定错误****msg:无法解析为属性的访问器或侦听器
- javascript - 这两个将函数分配给 const 的表达式有什么区别?
- angular - Ngrx TypeError:无法将未定义转换为对象