merge #3868: [shopify] fix 'collection' extractor
This commit is contained in:
@@ -119,15 +119,14 @@ class ShopifyCollectionExtractor(ShopifyExtractor):
|
|||||||
|
|
||||||
def products(self):
|
def products(self):
|
||||||
url = self.item_url + "/products.json"
|
url = self.item_url + "/products.json"
|
||||||
|
params = {"page": 1}
|
||||||
|
|
||||||
while url:
|
while True:
|
||||||
response = self.request(url)
|
data = self.request(url, params=params).json()["products"]
|
||||||
yield from response.json()["products"]
|
if not data:
|
||||||
|
|
||||||
url = response.links.get("next")
|
|
||||||
if not url:
|
|
||||||
return
|
return
|
||||||
url = url["url"]
|
yield from data
|
||||||
|
params["page"] += 1
|
||||||
|
|
||||||
|
|
||||||
class ShopifyProductExtractor(ShopifyExtractor):
|
class ShopifyProductExtractor(ShopifyExtractor):
|
||||||
|
|||||||
Reference in New Issue
Block a user