简体   繁体   中英

Getting item price from Amazon python API

I am new to amzon api and I am trying to print the attributes of items returned from the below code. .

    items = api.item_search('Books', Publisher="O'Reilly")
    for book in items:
        print book.ItemAttributes.Author, book.ItemAttributes.Title

This codes prints Author and Title of the books returned. But how can I get more details like the price of the book.

Are you trying to learn the api? Just do help(book.ItemAttributes). This will give you all the available methods.

Two things:

  • Have a look at the original API docs . The options can be passed, in most cases, directly to item_search (see wrapper docs for details).
  • Have a look at your XML element with import lxml.etree; lxml.etree.tostring(book, pretty_print=True) import lxml.etree; lxml.etree.tostring(book, pretty_print=True)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM