2014-03-07 28 views
0

我是新来的amzon api,我试图打印从下面的代码返回的项目的属性。 。从亚马逊python获取项目价格API

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

此代码打印返回书籍的作者和标题。但是,我怎样才能得到更多的细节,如书的价格。

回答

0

你想学习api吗?只要帮助(book.ItemAttributes)。这会给你所有可用的方法。

0

两件事情:

  • 看一看原来API docs。在大多数情况下,可以将选项直接传递到item_search(详情请参阅wrapper docs)。
  • 看看你的XML元素import lxml.etree; lxml.etree.tostring(book, pretty_print=True)
相关问题