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?
I have an lxml object called item and it may have a child called
Share
Try
hasattr().