I am using ixml to parse the XML doxument.
from lxml import etree
root=etree.XML(full xml tag file content)
if (next(root.iterfind(".//one_inner_tag")).text is None):
Print "NONE VALUE"
else:
Print root.iterfind(".//one_inner_tag")).text
While executing this code, I have faced an error like
if (next(root.iterfind(".//one_inner_tag")).text is None):
StopIteration
Because of the file content does not have that specific tag. If the Tag does not have a value means I need to print the NONE VALUE. But it prints the error.