如何仅使用Praw刮擦Reddit帖子?
在下面的代码下,我还找到了GIF,但是我只想找到图像帖子。 我可以为.gif过滤posturl_list,但我不知道如何删除与gif相关的posttitle_list中的标题。
posturl_list = []
posttitle_list = []
top_post = reddit.subreddit('memes').top("day", limit=12)
for post in top_post:
posturl = post.url
posttitle = post.title
posturl_list.append(posturl)
posttitle_list.append(posttitle)
with my code below I also find gifs, but I only want to find image posts.
I could filter posturl_list for .gif but I dont know how to delete the title in posttitle_list that is related to the gif.
posturl_list = []
posttitle_list = []
top_post = reddit.subreddit('memes').top("day", limit=12)
for post in top_post:
posturl = post.url
posttitle = post.title
posturl_list.append(posturl)
posttitle_list.append(posttitle)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您对它很好,则可以下载 reddownloader
If you are fine with it you can download RedDownloader
and then simply do