Python feedparser 无法读取 WordPress 自定义提要

标签 python django rss feedparser

我正在使用 Python2.7feedparser。我需要阅读 wordpress 网站的提要。我可以读取 Feed 中每个项目的一些常见 Feed 标签,例如 标题、内容...,但无法读取一些添加的自定义 Feed

提要网址为:http://www.aecinema.ir/feed/

您可以在“已添加的提要”的每个项目中看到图像标签,但我无法阅读。

我的代码:

feed = feedparser.parse("http://www.aecinema.ir/feed/")

for item in feed["items"]:
    print item["title"],  item["image"]

我还阅读了如下提要:

print feed.entries[0].title, feed.entries[0].image

但在每种情况下,错误都是相同的。

错误:对象没有属性“image”

代码有什么问题??? :(

最佳答案

代码很好,但提要无效。请参阅validation results .

<image>未在 RSS 2.0 specification 中定义作为<item>子元素,因此 feedparser 不处理它们。

关于Python feedparser 无法读取 WordPress 自定义提要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30410462/

相关文章:

javascript - Ajax RSS 阅读器

python - 模块turtle没有写入成员

Python - 返回嵌套列表中的字符串子串

POST 上的 django-rest-framework "This field is required"

python - 需要一些关于为 Django 编写可重用应用程序的建议

python - Django:可查询的计算字段

python - 在一行中检查输入 for 循环,python

Python 自动舍入小数

image - 如何在RSS中显示图像?

java - Rss Feed Java MVC