Skip to content

Instantly share code, notes, and snippets.

@cloverrose
Created April 14, 2012 09:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloverrose/2383141 to your computer and use it in GitHub Desktop.
Save cloverrose/2383141 to your computer and use it in GitHub Desktop.
example bottlenose.ASIN search
#coding: utf-8
access_key_id=''
secret_key=''
associate_tag='-22'
region='JP'
xmlns='{http://webservices.amazon.com/AWSECommerceService/2011-08-01}'
import bottlenose
from xml.etree.ElementTree import fromstring
def getASIN():
amazon=bottlenose.Amazon(access_key_id,secret_key,associate_tag,Region=region)
result=amazon.ItemLookup(ItemId='4063870901'
,IdType='ASIN'
,ResponseGroup='Small')
root=fromstring(result)
Items=root.find(xmlns+'Items')
for item in Items.findall(xmlns+'Item'):
print '--'
attrs=item.find(xmlns+'ItemAttributes')
if attrs:
print attrs.findtext(xmlns+'Title')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment