def lookup(self, URL=None, **kwargs): if URL: kwargs['ItemId'] = extract_asin(URL) result = self.amazon_simple_api.lookup(**kwargs) if isinstance(result, (list, tuple)): result = [Product(self, p) for p in result] else: result = Product(self, result) return result
def test_product(self): from amazon_scraper.product import Product p = self.amzn.api.lookup(ItemId="B00FLIJJSA") p = Product(self.amzn, p) p.to_dict()
def search_n(self, n, **kwargs): for p in self.amazon_simple_api.search_n(n, **kwargs): yield Product(self, p)
def similarity_lookup(self, **kwargs): for p in self.amazon_simple_api.similarity_lookup(**kwargs): yield Product(self, p)
def search_n(self, n, **kwargs): for p in self.api.search_n(n, **kwargs): yield Product(p)
def search(self, **kwargs): for p in self.api.search(**kwargs): yield Product(p)
def similarity_lookup(self, **kwargs): for p in self.api.similarity_lookup(**kwargs): yield Product(p)
def test_product(self): from amazon_scraper.product import Product p = self.amzn.api.lookup(ItemId='B00FLIJJSA') p = Product(self.amzn, p) p.to_dict()