读取图片:
原文链接:https://blog.csdn.net/m0_47603257/article/details/124173385
读取图片和值,进行保存
import os
from PIL import ImageGrab
import win32com
print(win32com.__gen_path__)
import win32com.client as win32
try:
ex=win32.gencache.EnsureDispatch('Excel.Application')
except Exception as e:
ex = win32.Dispatch('Excel.Application')
# wb=ex.Workbooks.Open(r'C:\Users\ThinkPad\Documents\WXWork\1688854685406270\Cache\File\2022-07\InstaGNG_Chile_product list_20220613.xlsx')
wb=ex.Workbooks.Open(r'C:\Users\ThinkPad\Documents\WXWork\1688854685406270\Cache\File\2022-07\InstaGNG_Chile_Newproduct list_20220703.xlsx')
save_dir=r'data'
os.makedirs(save_dir,exist_ok=True)
num=1
for i in wb.Worksheets:
if i.Name.lower()!='bottled':
continue
print(i.Name)
for n,shape in enumerate(i.Shapes):
if shape.Name.start