修改了一部分报错
This commit is contained in:
+21
-5
@@ -230,8 +230,23 @@ city_dict = {
|
||||
10001506: "金华",
|
||||
10001575: "温州",
|
||||
}
|
||||
# work_id = '第三次测试'
|
||||
# work_id = '第四次测试'
|
||||
item_list = []
|
||||
|
||||
def get_price(content):
|
||||
price = content.get("lxInfo", {}).get("sale_price", None)
|
||||
original_price = content.get("lxInfo", {}).get("origin_price", None)
|
||||
if price is None and original_price is None:
|
||||
price_list = content["showContents"]["12"]
|
||||
for i in price_list:
|
||||
if i['elementId']==72:
|
||||
groupDataInfo = i['elementInfo']["groupDataInfo"]
|
||||
for j in groupDataInfo:
|
||||
if j['constructionType'] == 'PriceText':
|
||||
price = j['singleDataInfo']["text"]
|
||||
return price, original_price
|
||||
|
||||
|
||||
def get_currentPage(price_str,da):
|
||||
if price_str == '?':
|
||||
print(da)
|
||||
@@ -314,8 +329,9 @@ for shop_id in shop_id_list:
|
||||
title = i.get("lxInfo", {}).get("content_name", "")
|
||||
goods_id = i.get("logicContents", {}).get("skuId", "")
|
||||
desc = i.get("lxInfo", {}).get("label", "")
|
||||
price = i.get("lxInfo", {}).get("sale_price", None)
|
||||
original_price = i.get("lxInfo", {}).get("origin_price", None)
|
||||
# price = i.get("lxInfo", {}).get("sale_price", None)
|
||||
# original_price = i.get("lxInfo", {}).get("origin_price", None)
|
||||
price,original_price = get_price(i)
|
||||
goods_tag = build_goods_tag(i, ocr_results)
|
||||
f_name = one_name
|
||||
f_id = one_id
|
||||
@@ -338,8 +354,8 @@ for shop_id in shop_id_list:
|
||||
token = "d7e0759c-8f52-4c82-8102-774da69416d5"
|
||||
vip_price = i.get("lxInfo", {}).get("member_price", None)
|
||||
da2 = (
|
||||
# work_id,
|
||||
str(datetime.date.today()).replace("-", ""),
|
||||
work_id,
|
||||
# "第五次测试",
|
||||
goods_id,
|
||||
s_id,
|
||||
station_id,
|
||||
|
||||
Reference in New Issue
Block a user