Created
February 12, 2021 21:59
-
-
Save jalbertbowden/9e5b3e6bf5229f2a5a440555832be4c2 to your computer and use it in GitHub Desktop.
Scrape document.xml with Python's BeautifulSoup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
docx_form = 'form_example/word/document.xml' | |
infile = open(docx_form, 'r') | |
contents = infile.read() | |
soup = BeautifulSoup(contents, 'xml') | |
xps = soup.find_all('wps:txbx') | |
for xp in xps: | |
print(xp.get_text()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment