I am trying to print the values inside tables and text boxes as seen in the attached sample:
Using the code below, I am trying to get the values inside the text box, but I am not able to get it. My document has a text box on top of a background image. To check if the image is causing issues, I placed another text box below the table, but the code is still not able to read the values from that text box.
Any suggestions?
from docx import Documentdoc = Document('Test.docx')for i, table in enumerate(doc.tables, 1): print(f"Table {i}:") for row in table.rows: for cell in row.cells: print(cell.text, end='\t') print() print()