【问题标题】:How to read all articles from a RSS feed?如何阅读 RSS 提要中的所有文章?
【发布时间】:2012-08-10 03:35:45
【问题描述】:

我正在使用 Python feedparser 从 RSS 提要中读取文章。但是,只能阅读文章的第一页。有没有其他的 lib/package 可以读取一个 RSS 提要的所有文章?

类似问题@SO:Feedparser - retrieve old messages from Google Reader

【问题讨论】:

    标签: python rss feed feedparser rss-reader


    【解决方案1】:

    RSS 本身可能只有第一页数据。您可以从 RSS 项目中的“链接”属性访问原始数据(至少在 feedparser 中是这样)。比如:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-04
      • 2012-07-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多