title: Python-docx: identify a page break in paragraph
body: <p>I iterate over document by paragraphs, then I split each paragraph text into sentences by <code>.</code> (dot with space). I split paragraph text in sentences i<em>n order to do more effective text search</em> compare to search in a whole paragraph text. </p>
  
  <p>Then the code searches error in each word of sentence, error being taken from error-correction db. I show below a simplified code:</p>
  
  <pre><code>from docx.enum.text import WD_BREAK
  
  for paragraph in document.paragraphs:
      sentences = paragraph.text.split('. ') 
      for sentence in sentences:
          words=sentence.split(' ')
          for word in words:
              for error in error_dictionary:
                   if error in word:
                       # (A) make simple replacement
                       word = word.replace(error, correction, 1)
                       # (B) alternative replacement based on runs 
                       for run in paragraph.runs:
                           if error in run.text:
                                 run.text = run.text.replace(error, correction, 1)
                           # here we may fetch page break attribute and knowing current number 
                           # find out at what page the replacement has taken place 
                           if run.page_break== WD_BREAK:
                                current_page_number +=1
                       replace_counter += 1
                       # write to a report what paragraph and what page
                       write_report(error, correction, sentence, current_page_number )  
                       # for that I need to know a page break    
  </code></pre>
  
  <p>The problem is how to identify if a run (or other paragraph element) contains a page break? Does <code>run.page_break == WD_BREAK</code> work?
  @scanny has showed <a href="https://stackoverflow.com/a/48655611/1230477">how to add page break</a>, but how to <strong>identify it</strong>?</p>
  
  <p>The best would be if one can identify also a <strong>line break in paragraph</strong>.   </p>
  
  <p>I could make: </p>
  
  <pre><code>for run in paragraph.runs:
      if run._element.br_lst:             
          for br in run._element.br_lst:
              br_couter+=1
              print br.type                
  </code></pre>
  
  <p>Yet this code shows only <strong>Hard breaks</strong>, that is, breaks inserted thru <em>Ctrl+Enter</em>. <strong>Soft page breaks</strong> are not detected... (<em>Soft page break</em> is formed when user keeps typing until the page he is on runs out then it flows on to the next page)</p>
  
  <p>Any hints?</p>