Commit 0f8817fe authored by rico.liu's avatar rico.liu

update

parent 86b27abc
...@@ -231,6 +231,7 @@ def checkData(check_data): ...@@ -231,6 +231,7 @@ def checkData(check_data):
elif "suning" in str(main_url): elif "suning" in str(main_url):
try: try:
sku = re.findall(".com/(.*?).html",main_url)[0] sku = re.findall(".com/(.*?).html",main_url)[0]
main_url_ = 'https://product.suning.com/' + sku + '.html' main_url_ = 'https://product.suning.com/' + sku + '.html'
r = get_response(session,main_url_,headers) r = get_response(session,main_url_,headers)
...@@ -267,13 +268,7 @@ def checkData(check_data): ...@@ -267,13 +268,7 @@ def checkData(check_data):
url_list.append(main_url) url_list.append(main_url)
source_list.append(source) source_list.append(source)
else: else:
print('通过')
result. append('通过')
id_all.append(date_id)
sku_list.append(sku)
name_list.append(name)
url_list.append(main_url)
source_list.append(source)
str11 = html.xpath("//input[@id='curPartNumber']/@value")[0] str11 = html.xpath("//input[@id='curPartNumber']/@value")[0]
str22 = html.xpath("//input[@id='shop_code']/@value")[0] str22 = html.xpath("//input[@id='shop_code']/@value")[0]
str33 = html.xpath("//input[@name='procateCode']/@value")[0] str33 = html.xpath("//input[@name='procateCode']/@value")[0]
...@@ -282,9 +277,23 @@ def checkData(check_data): ...@@ -282,9 +277,23 @@ def checkData(check_data):
sn_price = re.findall('"promotionPrice":"(.*?)",', price_response.text)[0] sn_price = re.findall('"promotionPrice":"(.*?)",', price_response.text)[0]
if len(sn_price) != 0: if len(sn_price) != 0:
price_list.append(sn_price) price_list.append(sn_price)
print('通过')
result. append('通过')
id_all.append(date_id)
sku_list.append(sku)
name_list.append(name)
url_list.append(main_url)
source_list.append(source)
else: else:
sn_price = price sn_price = price
price_list.append(sn_price) price_list.append(sn_price)
print('该地区不销售(北京市丰台区)')
result. append('该地区不销售(北京市丰台区)')
id_all.append(date_id)
sku_list.append(sku)
name_list.append(name)
url_list.append(main_url)
source_list.append(source)
else: else:
print('无货,请按要求提供在销渠道证明') print('无货,请按要求提供在销渠道证明')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment