You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to extract the text from the table cells in word and populating them into pandas DataFrame. I was successfully able to do that mainly with the help of this code:
document = Document(path_to_your_docx)
tables = document.tables
for table in tables:
for row in table.rows:
for cell in row.cells:
for paragraph in cell.paragraphs:
print(paragraph.text)
Hello Everyone,
I'm trying to extract the text from the table cells in word and populating them into pandas DataFrame. I was successfully able to do that mainly with the help of this code:
Thanks to @scanny
However, I get empty text when hyperlinks are encountered in the cell.
Alternatively, I'm able to extract all the hyperlinks from the document using this code:
But I would much rather prefer extracting them using cells object, this would allow me to place the hyperlinks corresponding to the row they belong.
Any help is appreciated !!!
Many Thanks,
Divyesh
The text was updated successfully, but these errors were encountered: