title: BeautifulSoup nth-of-type returns empty list. Soup.select()[n -1] returns the elements. Why?
body: <p>I'm trying to scrape <a href="https://en.wikipedia.org/wiki/Democratic_Party_presidential_primaries,_2004" rel="nofollow">this page</a></p>
  
  <p>My Soup selector is:</p>
  
  <pre><code>test = soup.select('#bodyContent &gt; #mw-content-text &gt; table.wikitable:nth-of-type(4)')
  </code></pre>
  
  <p>This should return the 4th child table of #cmw-content-text.</p>
  
  <p>But it's returning an empty list.</p>
  
  <p>But if I query:</p>
  
  <pre><code>test = soup.select('#bodyContent &gt; #mw-content-text &gt; table.wikitable')[3]
  </code></pre>
  
  <p>I do get the same selector.</p>
  
  <p>What am I missing in my implementation?</p>