ResponseException:尝试用Praw刮擦Reddit数据时接收到401 HTTP响应 - 如何进行身份验证?
我正在尝试从创建的应用程序中刮除一些Reddit数据,后来我想将它们输入到DataFrame PR CSV文件中。我不断收到以下错误:
ResponseException: received 401 HTTP response
我的代码是非常标准的:
import praw
reddit = praw.Reddit(client_id='', client_secret='', user_agent='', password='', username='',)
# get 10 hot posts from the MachineLearning subreddit
hot_posts = reddit.subreddit('MachineLearning').hot(limit=10)
for post in hot_posts:
print(post.title)
有关此错误的其他解决方案一直说您必须对自己进行身份验证。但是这是什么意思? The reddit solutions on https://github.com/reddit-档案/reddit/wiki/oauth2#应用程序 - only-oauth 仍然很困惑。
I am trying to scrape some reddit data from the application I created, I later want to input them into a dataframe pr CSV file. I keep receiving the following error:
ResponseException: received 401 HTTP response
My code is pretty standard:
import praw
reddit = praw.Reddit(client_id='', client_secret='', user_agent='', password='', username='',)
# get 10 hot posts from the MachineLearning subreddit
hot_posts = reddit.subreddit('MachineLearning').hot(limit=10)
for post in hot_posts:
print(post.title)
Other solutions about this error keep saying you have to authenticate yourself. But what does this mean? The reddit solutions on https://github.com/reddit-archive/reddit/wiki/OAuth2#application-only-oauth are still pretty confusing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论