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

New method similar_productos() of AmazonProduct object #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions amazon/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,21 @@ def __init__(self, item, aws_associate_tag, api, *args, **kwargs):
self.parent = None
self.region = kwargs.get('region', 'US')

@property
def similar_products(self):
"""SimlarProducts.

:return:
List Of ASIN Similar Products (list)
"""

result = []
similar_products = self._safe_get_element('SimilarProducts.SimilarProduct')
if similar_products is not None:
for similar_product in similar_products:
result.append(similar_product.ASIN.text)
return result

@property
def price_and_currency(self):
"""Get Offer Price and Currency.
Expand Down