using minidom to parse xml

thaier abbas

New Member
Hi I have trouble understanding the minidom module for Python. I have xml that looks like this:\[code\]<Show><name>Dexter</name><totalseasons>7</totalseasons><Episodelist><Season no="1"><episode><epnum>1</epnum><seasonnum>01</seasonnum><prodnum>101</prodnum><airdate>2006-10-01</airdate><link>http://www.tvrage.com/Dexter/episodes/408409</link><title>Dexter</title></episode><episode><epnum>2</epnum><seasonnum>02</seasonnum><prodnum>102</prodnum><airdate>2006-10-08</airdate><link>http://www.tvrage.com/Dexter/episodes/408410</link><title>Crocodile</title></episode><episode><epnum>3</epnum><seasonnum>03</seasonnum><prodnum>103</prodnum><airdate>2006-10-15</airdate><link>http://www.tvrage.com/Dexter/episodes/408411</link><title>Popping Cherry</title></episode>\[/code\]More pretty: http://services.tvrage.com/feeds/episode_list.php?sid=7926And this is my python code trying to read from that:\[code\]xml = minidom.parse(urlopen("http://services.tvrage.com/feeds/episode_list.php?sid=7926"))for episode in xml.getElementsByTagName('episode'): for node in episode.attributes['title']: print node.data\[/code\]I can't get the actual episode data out as I want to get all the data from each episode. I've tried different variants but I can't get it to work. Mostly I get a \[code\]<DOM Element: asdasd>\[/code\] back. I only care about the data inside each episode.Thanks for the help
 
Back
Top