title: Ignoring content below certain ID in Wikipedia using Beautiful Soup
body: <p>In the following links: </p>
  
  <p><a href="https://en.wikipedia.org/wiki/America" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/America</a></p>
  
  <p>I need to grab the content inside the h2, h3 and p tags. HOWEVER, I want to ignore the header and the content in:</p>
  
  <ol>
  <li>"See Also"</li>
  <li>"Notes"</li>
  <li>"References"</li>
  <li>Ignore all tables/urls </li>
  </ol>
  
  <p>How would I accomplish this in Beautiful Soup? My current code is as follows: </p>
  
  <pre><code>    def open_document():
      for i in range (1, 1+1):
          with open(directory_of_raw_documents + str(i), "r") as document:
              html = document.read()
              soup = BeautifulSoup(html, "html.parser")
              body = soup.find('div', id='bodyContent')
              results = ""
              for item in body.find_all(['h2','h3','p']):
                  results += item.get_text() + "\n"
                  results = results.replace("[edit]","")
              print(results)
  
  open_document()
  </code></pre>
  
  <p>My desired output would not have any content in any table, See All, Notes, or Reference sections. I would prefer to not use the Wikipedia module in Python 2.7</p>