Commits

Sebastian Rahlf committed 098fcc4

Fixed paginator for related items in ItemLookup operation. Paginating over related items in ItemSearch doesn't make much sense!

Comments (0)

Files changed (2)

amazonproduct/processors/etree.py

         cart.url = root.findtext(_xpath('./{}PurchaseURL'))
 
         def parse_item(item_node):
-            from lxml.etree import tostring
-            print tostring(item_node, pretty_print=True)
             item = Item()
             item.item_id = item_node.findtext(_xpath('./{}CartItemId'))
             item.asin = item_node.findtext(_xpath('./{}ASIN'))
 
     counter = 'RelatedItemPage'
     current_page_xpath = './/{}RelatedItemPage'
-    total_pages_xpath = (
-        './/{}Items/{}TotalPages'
-        '|.//{}RelatedItems/{}RelatedItemPageCount')
-    total_results_xpath = (
-        './/{}Items/{}TotalResults'
-        '|.//{}RelatedItems/{}RelatedItemCount')
-    items = './/{}Items/{}Item'
+    total_pages_xpath = './/{}RelatedItems/{}RelatedItemPageCount'
+    total_results_xpath = './/{}RelatedItems/{}RelatedItemCount'
+    items = './/{}:RelatedItems/{}:RelatedItem/{}:Item'

amazonproduct/processors/objectify.py

     """
     counter = 'RelatedItemPage'
     current_page_xpath = '//aws:RelatedItemPage'
-    total_pages_xpath = '//aws:Items/aws:TotalPages|//aws:RelatedItems/aws:RelatedItemPageCount'
-    total_results_xpath = '//aws:Items/aws:TotalResults|//aws:RelatedItems/aws:RelatedItemCount'
-    items = '//aws:Items/aws:Item'
+    total_pages_xpath = '//aws:RelatedItems/aws:RelatedItemPageCount'
+    total_results_xpath = '//aws:RelatedItems/aws:RelatedItemCount'
+    items = '//aws:RelatedItems/aws:RelatedItem/aws:Item'