开发者

XML parsing gives me empty values

Having trouble getting this to work. What's strange is that I have 10 bookmarks in Delicious and it prints out 10 blank strings so it must be close to working.

import urllib
from xml.dom.minidom import parse

FEED = 'http://feeds.delicious.com/v2/rss/migra开发者_运维百科ntgeek'

dom = parse(urllib.urlopen(FEED))

for item in dom.getElementsByTagName('item'):
    print item.getAttribute('title')


Title isn't an attribute, it's another tag within item.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜