from docx import Document

word =Document(r'表格名称.docx')

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

tables=word.tables

for i in tables[:]:

  for j,row in enumerate(i.rows[:]):

    row_content=[]

    for cell in row.cells[:]  :   #读取每行中的所有单元格

      c=cell.text

      row_content.append(c)

    print(row_content)    #打印一行的信息

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄