我使用Python2.7
和feedparser
。我需要閱讀wordpress
網站的Feed。我可以閱讀一些常見的Feed標籤,例如title, content
,... Feed中的每個項目,但我無法閱讀一些custom feed that added
。Python feedparser無法讀取WordPress自定義提要
該提要的網址是:http://www.aecinema.ir/feed/。
您可以在每個項目中看到圖像標籤,這是「已添加的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
但是在每種情況下的錯誤是一樣的。
錯誤:object has no attribute 'image'
什麼是錯誤的代碼??? :(
非常感謝,所以根據RSS 2.0規範,「機箱」鍵描述了附加到該項目的媒體對象。所以我必須要求Wordpress網站管理員在訂閱源中定義「機箱」鍵而不是圖像;)。 –