Retrieve document content with document structure with python-docx

前端 未结 2 1321
误落风尘
误落风尘 2021-01-21 07:46

I have to retrieve tables and previous/next paragraphs from docx file, but can\'t imagine how to obtain this with python-docx

I can get a list

2条回答
  •  -上瘾入骨i
    2021-01-21 08:14

    Resolved as property Document.story, contains paragraphs and tables in document order

    https://github.com/python-openxml/python-docx/pull/395

    document = Document('test.docx')
    document.story
    

提交回复
热议问题