kensvin commited on
Commit
f964a19
·
1 Parent(s): c034fa1
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -172,13 +172,13 @@ def scrape(product_id, max_reviews=LIMIT):
172
  has_next = True
173
 
174
  logger.info("Extracting product reviews...")
175
- while has_next and len(all_reviews) <= max_reviews:
176
- response = request_product_review(product_id, page=page)
177
- data = response.json()["data"]["productrevGetProductReviewList"]
178
- reviews = data["list"]
179
- all_reviews.extend(reviews)
180
- has_next = data["hasNext"]
181
- page += 1
182
 
183
  reviews_df = pd.json_normalize(all_reviews)
184
  reviews_df.rename(columns={"message": "comment"}, inplace=True)
 
172
  has_next = True
173
 
174
  logger.info("Extracting product reviews...")
175
+ # while has_next and len(all_reviews) <= max_reviews:
176
+ response = request_product_review(product_id, page=page)
177
+ data = response.json()["data"]["productrevGetProductReviewList"]
178
+ reviews = data["list"]
179
+ all_reviews.extend(reviews)
180
+ has_next = data["hasNext"]
181
+ page += 1
182
 
183
  reviews_df = pd.json_normalize(all_reviews)
184
  reviews_df.rename(columns={"message": "comment"}, inplace=True)