如何阅读RSS提要中的所有文章?

nor*_*ree 7 python rss feed feedparser rss-reader

我正在使用Python feedparser从RSS提要中读取文章.但是,只能阅读第一页的文章.是否有任何其他lib /包可以读取RSS提要的所有文章?

类似问题@ SO:Feedparser - 从Google阅读器中检索旧邮件

laz*_*zy1 10

RSS本身可能只是第一页数据.您可以从RSS项目中的"link"属性访问原始数据(至少在feedparser中调用它).就像是:

feed = feedparser.parse('http://reddit.com/.rss')
for entry in feed['entries']:
    content = urlopen(entry['link']).read()
    # Do something with content
Run Code Online (Sandbox Code Playgroud)