from openpyxl import load_workbook
workbook = load_workbook(r"C:\Users\ben_ma\Desktop\新建 XLSX 工作表.xlsx")
num = 1
for sheet_name in workbook.sheetnames:
worksheet = workbook[sheet_name]
for image in worksheet._images:
img_data = image._data()
# 保存图像的二进制数据为文件
with open(f'image_{num}.jpg', 'wb') as f:
f.write(img_data)
num += 1
标签:load,openpyxl,image,excel,num,workbook,识别,data
From: https://www.cnblogs.com/bnmm/p/17693553.html