title: python-docx get Header text
body: <p>I want to read header text from a docx file in Python. I am using python-docx module.</p>
  
  <p>Can someone help me to do this, if this feature has already been implemented.</p>
  
  <p>I tried to do this this way, but didn't get a success.</p>
  
  <pre><code>from docx import Document
  
  document = Document(path)
  section = document.sections[0]
  print(section.text)
  
  Error:
      &lt;class 'AttributeError'&gt;'Section' object has no attribute 'text'
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>from docx import Document
  
  document = Document(path)
  header = document.sections[0].header
  print(header.text)
  
  Error:
      &lt;class 'AttributeError'&gt;'Section' object has no attribute 'header'
  </code></pre>