how to traverse nodes of lxml object to see if an attribute exists?

Question:

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

Asked By: brain storm

||

Answers:

with lxml you can use xpath to search for the attribute like this:

lxml.xpath(['//*[@Identifier]'])
Answered By: Guy Gavriely
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.