I need to check certain attributes for existence. Like:
if "blah-blah-blah" is None:
print "there is no such attribute"
else:
print "The attribute exists"
Element
objects have all the attributes in the attrib
dict.
if 'blah' not in elem.attrib:
print "there is no such attribute"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With