title: How to find body tag in HTML file with an unknown class?
body: <p>Recently, I'm having online lessons and after each lesson, we have to export our work from Google Docs to HTML file so we can upload it to our websites. Google Docs exported HTML file has really messy code and the body tag always has different classes like: "c47", "c72", "c21", "c38" etc. Just a "c" letter with some random number after it I guess. The main problem is that after the body tag I want to add my button (CSS button, that is not the problem though) but when I tried to use <code>bs4</code>:</p>
  
  <pre class="lang-py prettyprint-override"><code>from bs4 import BeautifulSoup as Soup
  from bs4 import NavigableString
  
  html = open("new_html_file.html", "w+")
  soup = Soup(html, features="html.parser")
  body = soup.find('body')
  button = soup.new_tag('button')
  button['class'] = "cupid-blue"
  button['onclick'] = "location.href=\'index.html\';"
  button.insert(0, NavigableString("Button text"))
  body.insert_after(button)
  br_line = soup.new_tag('br')
  button.insert_after(br_line)
  
  html.write(str(soup.prettify()))
  html.close()
  </code></pre>
  
  <p>It says that <code>'NoneType' object has no attribute 'insert_after'</code> and the error is in line with <code>body = soup.find('body')</code> so basically it can't find the body tag because it seems that the body tag contains this class: "c47 c73" right? Every file has a different body tag class though, so I can't just hard code it. </p>
  
  <p>My question is: <strong>Can I insert my button tag below the body tag (it must be on top of the whole webpage) not knowing the body's tag class?</strong></p>