我正在尝试解析具有视频条目和这些视频的一些元数据的MRSS Feed。这是一个条目:
<item>
<title>Harry Potter and the Sorcerers Stone</title>
<guid>http://video.videos.com/watch/harry-potter</guid>
<link>http://video.videos.com/watch/harry-potte</link>
<pubDate>Fri, 03 Mar 2017 21:29:47 +0000</pubDate>
<media:title>Harry Potter and the Sorcerers Stone</media:title>
<media:description>"Harry Potter battles Voldemort"</media:description>
<media:status state="active"/>
<media:category label="Magic">Magic</media:category>
<brand:id>123456</brand:id>
<brand:credit type="main">Emma Watson</brand:credit>
<brand:credit type="main">Daniel Radcliffe</brand:credit>
<brand:credit type="videographer">Universal</brand:credit>
<brand:category>Magic</brand:category>
<brand:premiere_date>Mon, 6 Mar 2017 11:00:00 +0000</brand:premiere_date>
<brand:lastModifiedDate>Fri, 03 Mar 2017 21:29:47 +0000</brand:lastModifiedDate>
</item>
当我使用feedparser
解析时,我会获得所有密钥,但entry.brand_credit
会产生{'type': u'videographer'}
。
我希望获得的是某种类型的列表,可能是:
[{'main':'Emma Watson'},{'main':'Daniel Radcliffe'},{'videographer':'Universal'}]`
或者实际上只是非词典列表中的所有名称。是否有feedparser
跳到最后<brand:credit>
代码的原因?有没有办法找到其他人?