title: Getting the right tag with BeautifulSoup (problem)
body: <p>I want to get the &quot;tbody&quot; element from the html of this website, but the command seems to include the &quot;thead&quot; element as well. Why?</p>
  <p>My code:</p>
  <pre><code>from bs4 import BeautifulSoup
  
  import requests 
  
  import re
  
  site1 = requests.get(&quot;https://en.wikipedia.org/wiki/List_of_chemical_elements&quot;)
  
  soup1 = BeautifulSoup(site1.text, &quot;html.parser&quot;)
      
  body_ = soup1.tbody
  
  print(body_.contents[0])
  </code></pre>
  <p>This prints me the first child of <em>&quot;thead&quot;</em> element although it should give me the first child of <em>&quot;tbody&quot;</em>.</p>
  <p>output:</p>
  <pre><code>&lt;tr&gt;
  &lt;th colspan=&quot;13&quot;&gt;List of chemical elements
  &lt;/th&gt;&lt;/tr&gt;
  </code></pre>
  <p>Now I didn't copy the source code here since it is too large but here is a link to the site of the source code used:</p>
  <p><a href="https://en.wikipedia.org/wiki/List_of_chemical_elements" rel="nofollow noreferrer">site of source code</a></p>