我想使用提要解析器来操作包含经常更新(随时间)内容的提要。目标是显示更新提要的所有内容。
import feedparser
d = feedparser.parse("some URL")
print "Information of user"
i = range(10)
for i in d:
print d.entries[i].summary
print " "
由于解析数据是列表,并且列表不接受字符串作为索引,因此显示错误
喜欢:
File "F:\JavaWorkspace\Test\src\rss_parse.py", line 18, in <module>
print d.entries[i].summary
TypeError: list indices must be integers
那我怎样才能得到所有的内容呢?谁能告诉我一些关于这个问题的信息?提前致谢!