Python xpath not working?
问题 Okay, this is starting to drive me a little bit nuts. I've tried several xml/xpath libraries for Python, and can't figure out a simple way to get a stinkin' "title" element. The latest attempt looks like this (using Amara): def view(req, url): req.content_type = 'text/plain' doc = amara.parse(urlopen(url)) for node in doc.xml_xpath('//title'): req.write(str(node)+'\n') But that prints out nothing. My XML looks like this: http://programanddesign.com/feed/atom/ If I try //* instead of //title