modified: amazon/similar_asin.py
This commit is contained in:
@@ -333,7 +333,7 @@ class ChromeAmzone(ChromeAmzoneBase):
|
|||||||
category=data["category"],
|
category=data["category"],
|
||||||
imageBase64 = iamge_base64
|
imageBase64 = iamge_base64
|
||||||
)
|
)
|
||||||
self.log(f"Aliprice 扩展数据获取:{resp_data}")
|
self.log(f"Aliprice 扩展数据获取:{str(resp_data)[0:200]}")
|
||||||
if len(resp_data.get("data",[])) > 0:
|
if len(resp_data.get("data",[])) > 0:
|
||||||
for i in resp_data.get("data"):
|
for i in resp_data.get("data"):
|
||||||
similar_data.append(i)
|
similar_data.append(i)
|
||||||
@@ -490,7 +490,7 @@ class SimilarAsinTask(TaskBase):
|
|||||||
country = value.get("country")
|
country = value.get("country")
|
||||||
for _ in range(max_retry):
|
for _ in range(max_retry):
|
||||||
try:
|
try:
|
||||||
return_data = chrome.run(country, asin,total_page=3) or {}
|
return_data = chrome.run(country, asin,total_page=2) or {}
|
||||||
self.log(f"抓取结果->{return_data}")
|
self.log(f"抓取结果->{return_data}")
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -529,9 +529,9 @@ class SimilarAsinTask(TaskBase):
|
|||||||
"items": group_item
|
"items": group_item
|
||||||
}
|
}
|
||||||
|
|
||||||
print("================")
|
# print("================")
|
||||||
result.append(res)
|
result.append(res)
|
||||||
print("================")
|
# print("================")
|
||||||
is_done = gp_index == len(groups)-1
|
is_done = gp_index == len(groups)-1
|
||||||
if len(result) > 5 or is_done:
|
if len(result) > 5 or is_done:
|
||||||
self.post_result(task_id=task_id,chunkIndex=gp_index+1,chunkTotal=len(groups),
|
self.post_result(task_id=task_id,chunkIndex=gp_index+1,chunkTotal=len(groups),
|
||||||
|
|||||||
Reference in New Issue
Block a user