Skip to content

Instantly share code, notes, and snippets.

@jalbertbowden
Created February 12, 2021 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalbertbowden/ccf13fbf353c5383a08e5f81a0642dbd to your computer and use it in GitHub Desktop.
Save jalbertbowden/ccf13fbf353c5383a08e5f81a0642dbd to your computer and use it in GitHub Desktop.
Scrape .docx with python-docx library.
from docx import Document
document = Document('form_example.docx')
document.save('form_example.docx')
for table in document.tables:
for row in table.rows:
for cell in row.cells:
for para in cell.paragraphs:
print(para.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment