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

有帮助吗?

解决方案

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

lxml.xpath(['//*[@Identifier]'])
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top