Commits

Sebastian Rahlf committed 41ec452 Draft

Edited online

  • Participants
  • Parent commits 602aa75

Comments (0)

Files changed (1)

 ASSOCIATE_TAG = '...'
 
 api = API(AWS_KEY, SECRET_KEY, 'de', ASSOCIATE_TAG)
-node = api.item_search('Books', Publisher='Galileo Press')
-
-# node object returned is a lxml.objectified element
-# .pyval will convert the node content into int here
-total_results = node.Items.TotalResults.pyval
-total_pages = node.Items.TotalPages.pyval
-
-# get all books from result set and
-# print author and title
-for book in node.Items.Item:
-    print '%s: "%s"' % (book.ItemAttributes.Author,
-                        book.ItemAttributes.Title)
+for page in api.item_search('Books', Publisher='Galileo Press'):
+    for product in page.Items.Item:
+        print product
 }}}
 
 All its content can be accessed using the [[http://codespeak.net/lxml/objectify.html|lxml.objectify]] API.