Arthur-Wu committed this file on 2024-11-27
This commit is contained in:
@ -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() # step1:session开始
|
||||
Payload01 = {"action": 0, "isAnon": True}
|
||||
|
Reference in New Issue
Block a user