Answer the question
In order to leave comments, you need to log in
How to extract information from specific table cells of a .docx file using python and the docx library?
It is necessary to extract a certain cell from a table in a docx file (by column heading). I am using the docx library. It seems that I read the documentation, but so far I have not understood anything.
Answer the question
In order to leave comments, you need to log in
What is there to understand?
from docx import Document
document = Document('document.docx')
table = document.tables[0]
cell = table.cell(0, 1)
print(cell.text)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question