Return single RSS element

This commit is contained in:
Ruud committed 2012-02-03 20:37:31 +01:00
1 parent 5028129e5e
commit 52fc675cb6
1 file changed
+9 -1
+9 -1
View File
@@ -19,7 +19,7 @@ class RSS(object):
def getElements(self, xml, path): def getElements(self, xml, path):
elements = [] elements = None
try: try:
elements = xml.findall(path) elements = xml.findall(path)
except: except:
@@ -27,6 +27,14 @@ class RSS(object):
return elements return elements
def getElement(self, xml, path):
''' Find element and return text'''
try:
return xml.find(path)
except:
return
def getTextElement(self, xml, path): def getTextElement(self, xml, path):
''' Find element and return text''' ''' Find element and return text'''