简体   繁体   English

用Python中的PRAW将subreddit与提交进行匹配

[英]matching subreddit with submission with PRAW in Python

I want to collect the stream of all reddit submissions with their corresponding subreddits. 我想收集所有reddit提交及其对应的subreddit的流。 With the following structure: Column1 = subreddit ; 具有以下结构:Column1 = subreddit; column2 = submission title column2 =提交标题

I now have the following code, but I am unable to get the subreddits title. 我现在有以下代码,但是我无法获得subreddits标题。

for submission in reddit.subreddit('all').hot(limit=None):
print(subreddit.display_name)

How can I obtain the corresponding title? 如何获得相应的标题?

To get the name of the subreddit the submission is being posted in, use the following: 要获取要提交提交的子reddit的名称,请使用以下命令:

for submission in reddit.subreddit('all').hot(limit=None):
    print(submission.subreddit)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM