Having trouble parsing a tag with a namespace prefix
HiI am making a plugin for DR (Danish National TV), but I am having trouble parsing a rss feed xml tag with a namespace prefix.
This is my code:
[codebox]PLUGIN_NAMESPACE = {'itunes':'http://www.itunes.com/dtds/podcast-1.0.dtd'}
url = "http://vpodcast.dr.dk/feeds/deadline_2sektionrss.xml"
feed = XML.ElementFromURL(url, errors="ignore").xpath('//channel', namespaces=PLUGIN_NAMESPACE)[0]
desc = feed.find('description').text
#img = feed.find('itunes:image').get('href')
img = video.xpath('itunes:image', namespaces=PLUGIN_NAMESPACE)[0].get('href')
retInfo = (desc, img)[/codebox]
It is the itunes:image bit that is the troublemaker.
I tried looking at other plugin examples and googled how xpath works, but for no avail.
Any help would be greatly appreciated.
Thanks a bunch for the quick help!