How it works...

This recipe uses the third-party bottlenose library's Amazon() class to create an
object for searching Amazon through the product search API. This is done by the top-level search_for_books() function. The ItemSearch() method of this object is invoked with passing values to the SearchIndex and Keywords keys. It uses the relevancerank method to sort the search results.

The search results are processed using the XMLmodule's minidom interface, which has a useful parseString() method. It returns the parsed XML tree-like data structure. The getElementsByTagName() method on this data structure helps to find the item's information. The item attributes are then looked up and placed in a dictionary of parsed items. Finally, all the parsed items are appended in a all_items() list and returned to the user.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.70.21