# Extract text from the document text = [] for para in doc.paragraphs: text.append(para.text) text = '\n'.join(text)