Spaces:
Paused
Paused
fix url parsing
Browse files
app.py
CHANGED
|
@@ -204,7 +204,7 @@ def scrape(product_id, max_reviews=LIMIT):
|
|
| 204 |
# Function to extract product ID from URL
|
| 205 |
def get_product_id(URL):
|
| 206 |
parsed_url = urlparse(URL)
|
| 207 |
-
_, shop, product_key = parsed_url.path.
|
| 208 |
response = request_product_id(shop, product_key)
|
| 209 |
if response:
|
| 210 |
product_id = response.json()["data"]["pdpGetLayout"]["basicInfo"]["id"]
|
|
|
|
| 204 |
# Function to extract product ID from URL
|
| 205 |
def get_product_id(URL):
|
| 206 |
parsed_url = urlparse(URL)
|
| 207 |
+
*_, shop, product_key = parsed_url.path.split("/")
|
| 208 |
response = request_product_id(shop, product_key)
|
| 209 |
if response:
|
| 210 |
product_id = response.json()["data"]["pdpGetLayout"]["basicInfo"]["id"]
|