本代码从 sebsauvage.net 读取RSS2.0文档,并对其进行分析并显示全部标题
import urllib, sys, xml.dom.minidom address = 'http://www.75271.com.net/rss/updates.xml' document = xml.dom.minidom.parse(urllib.urlopen(address)) for item in document.getElementsByTagName('item'): title = item.getElementsByTagName('title')[0].firstChild.data print "Title:", title.encode('latin-1','replace')