我想用Python制作Atom Reader

时间:2011-09-06 09:00:46

标签: php python news-feed

我正在尝试使用Python制作Atom Reader(0.3)。

我熟悉php,我想在python中使用一些等效的命令。

如果我使用的是php,我会使用file_get_contents并从中解析这些Atom。

也许使用Simplexml解析器。

是否有类似$ file_get_contents的命令?

我还下载了Universal Feed Reader(Python RSS / Atom Reader Module)

但我找不到任何例子。

我想看看至少使用Universal Feed Reader的例子。

1 个答案:

答案 0 :(得分:5)

查看Universal Feed Parser的文档。首页只是例子:

>>> import feedparser
>>> d = feedparser.parse("http://feedparser.org/docs/examples/atom10.xml")
>>> d['feed']['title']             # feed data is a dictionary
u'Sample Feed'
相关问题