I have an lxml object called item and it may have a child called item.brand, however it's possible that there is none as this is returned from an API. How can I check this in Python?
Try hasattr().
How can I see if a child exists in Python?