Poxerramsseah
New Member
I am trying to parse the xml from youtube that is embedded in the code below. I am trying to display all of the titles. However, I am running into trouble when I try to print the 'title' only enter lines appear. Any advice?\[code\]#import library to do http requests:import urllib2#import easy to use xml parser called minidom:from xml.dom.minidom import parseString#all these imports are standard on most modern python implementations#download the file:file = urllib2.urlopen('http://gdata.youtube.com/feeds/api/users/buzzfeed/uploads?v=2&max-results=50')#convert to string:data = http://stackoverflow.com/questions/12783730/file.read()#close file because we dont need it anymore:file.close()#parse the xml you downloadeddom = parseString(data)entry=dom.getElementsByTagName('entry')for node in entry: video_title=node.getAttribute('title') print video_title\[/code\]