I\'m often having code written as follows
try: self.title = item.title().content.string except AttributeError, e: self.title = None
Assuming the AttributeError happens on string:
string
self.title = getattr(item.title().content, 'string', None)