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.
精彩评论