Пример #1
0
    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
Пример #2
0
    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()
Пример #3
0
 def search_n(self, n, **kwargs):
     for p in self.amazon_simple_api.search_n(n, **kwargs):
         yield Product(self, p)
Пример #4
0
 def similarity_lookup(self, **kwargs):
     for p in self.amazon_simple_api.similarity_lookup(**kwargs):
         yield Product(self, p)
Пример #5
0
 def search_n(self, n, **kwargs):
     for p in self.api.search_n(n, **kwargs):
         yield Product(p)
Пример #6
0
 def search(self, **kwargs):
     for p in self.api.search(**kwargs):
         yield Product(p)
Пример #7
0
 def similarity_lookup(self, **kwargs):
     for p in self.api.similarity_lookup(**kwargs):
         yield Product(p)
Пример #8
0
 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()