Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

product.images module returns empty list #132

Open
gerimo opened this issue Mar 22, 2018 · 2 comments
Open

product.images module returns empty list #132

gerimo opened this issue Mar 22, 2018 · 2 comments

Comments

@gerimo
Copy link

gerimo commented Mar 22, 2018

Empty image list:

product = amazon.lookup(ItemId="B006OVWT08")
return product.images 

Returns: [, , , , , ]

@ilyaresh
Copy link

Hi @gerimo,
It seems to work for me
it returns a list of object and you can access each object's elements

product = amazon.lookup(ItemId="B006OVWT08")
    images = product.images
    for image in images:
        print ("\nImage Object:\n%s" %(image.__dict__))
        print("Medium Image URL: %s" %(image.MediumImage.URL))

Will produce the following
`
Image Object:
{'SwatchImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SwatchImage at 0x1072d3088>, 'SmallImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SmallImage at 0x1072d30c8>, 'ThumbnailImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}ThumbnailImage at 0x1072d3148>, 'TinyImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}TinyImage at 0x1072d31c8>, 'MediumImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}MediumImage at 0x1072d3248>, 'LargeImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}LargeImage at 0x1072d32c8>, 'HiResImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}HiResImage at 0x1072d3348>}
Medium Image URL: https://images-na.ssl-images-amazon.com/images/I/41kRMPzeRjL._SL160_.jpg

Image Object:
{'SwatchImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SwatchImage at 0x1072d33c8>, 'SmallImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SmallImage at 0x1072d3348>, 'ThumbnailImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}ThumbnailImage at 0x1072d3388>, 'TinyImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}TinyImage at 0x1072d3308>, 'MediumImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}MediumImage at 0x1072d3288>, 'LargeImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}LargeImage at 0x1072d3208>}
Medium Image URL: https://images-na.ssl-images-amazon.com/images/I/4144aRNhG2L._SL160_.jpg

Image Object:
{'SwatchImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SwatchImage at 0x1072d3188>, 'SmallImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SmallImage at 0x1072d3208>, 'ThumbnailImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}ThumbnailImage at 0x1072d30c8>, 'TinyImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}TinyImage at 0x1072d3148>, 'MediumImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}MediumImage at 0x1072d31c8>, 'LargeImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}LargeImage at 0x1072d3248>, 'HiResImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}HiResImage at 0x1072d32c8>}
Medium Image URL: https://images-na.ssl-images-amazon.com/images/I/51-FBfkDcbL._SL160_.jpg

Image Object:
{'SwatchImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SwatchImage at 0x1072d3108>, 'SmallImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SmallImage at 0x1072d32c8>, 'ThumbnailImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}ThumbnailImage at 0x1072d3088>, 'TinyImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}TinyImage at 0x1072d33c8>, 'MediumImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}MediumImage at 0x1072d3348>, 'LargeImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}LargeImage at 0x1072d3388>, 'HiResImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}HiResImage at 0x1072d3308>}
Medium Image URL: https://images-na.ssl-images-amazon.com/images/I/51UIpD-R0lL._SL160_.jpg

Image Object:
{'SwatchImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SwatchImage at 0x1072d3288>, 'SmallImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SmallImage at 0x1072d3308>, 'ThumbnailImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}ThumbnailImage at 0x1072d3188>, 'TinyImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}TinyImage at 0x1072d3208>, 'MediumImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}MediumImage at 0x1072d30c8>, 'LargeImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}LargeImage at 0x1072d3148>}
Medium Image URL: https://images-na.ssl-images-amazon.com/images/I/41zi8B17qSL._SL160_.jpg

Image Object:
{'SwatchImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SwatchImage at 0x1072d31c8>, 'SmallImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}SmallImage at 0x1072d3148>, 'ThumbnailImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}ThumbnailImage at 0x1072d32c8>, 'TinyImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}TinyImage at 0x1072d3088>, 'MediumImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}MediumImage at 0x1072d33c8>, 'LargeImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}LargeImage at 0x1072d3348>, 'HiResImage': <Element {http://webservices.amazon.com/AWSECommerceService/2013-08-01}HiResImage at 0x1072d3388>}
Medium Image URL: https://images-na.ssl-images-amazon.com/images/I/51spMo8afQL._SL160_.jpg
`

@gerimo
Copy link
Author

gerimo commented Apr 19, 2018

@ilyaresh Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants