Arthur-Wu committed this file on 2024-11-27

This commit is contained in:
ieemoo
2024-11-27 18:00:09 +08:00
parent 0d74d0787b
commit 9af4fe3ef4
7 changed files with 67 additions and 95 deletions

View File

@ -293,10 +293,31 @@ class YMClientApi(object):
logging.info(f"-----------接口返回数据:{response.json()}\n\n")
return response.json()
def traverse_the_barcode_of_the_prod(self, FP):
'''
根据商品Barcode遍历商品信息
:return:
'''
logging.info("========== [根据商品Barcode遍历商品信息] ==========")
'''
1- 遍历读取Barcode
2、根据Barcode遍历请求接口
3、根据Barcode查询情况回写商品信息
'''
def get_barcode_data():
import xlrd
workbook = xlrd.open_workbook(FP)
sheet = workbook.sheet_by_index(0)
first_column = []
for row in range(sheet.nrows):
first_column.append(sheet.cell_value(row, 0))
return first_column
for barcode in get_barcode_data():
logging.info(f"-----------当前Barcode为{barcode}")
if __name__ == '__main__':
ymc = YMClientApi()
ymc = YMClientApi(ShoppingCartMac='')
''' 01- '''
ymc.session_start() # step1session开始
Payload01 = {"action": 0, "isAnon": True}