문제

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