Reputation: 31252
I using amazon-python-product-api to search for products in amazon. The search returns a lxml object as below
<class 'amazonproduct.processors._lxml.SearchPaginator'>
I am interested in getting all the attributes of this lmxl object
(I am particularly interested
in the attribute Identifier
if it exists).
I found a couple of post related to this. but not what I am looking for.
Is there a look-up available on lxml
object to see if an attribute exists
.
From my reading of lxml
documentation, there is not one, but I could be totally wrong
Upvotes: 1
Views: 262
Reputation: 11396
with lxml you can use xpath to search for the attribute like this:
lxml.xpath(['//*[@Identifier]'])
Upvotes: 1