title: Why does error 'NoneType' object has no attribute 'contents' occur with only one of two similar commands?
body: <p>I'm extracting content from this <a href="https://www.collinsdictionary.com/dictionary/french-english/aimer" rel="nofollow noreferrer">url</a>.</p>
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  url = 'https://www.collinsdictionary.com/dictionary/french-english/aimer'
  headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0'}
  soup = BeautifulSoup(requests.get(url, headers = headers).content, 'html.parser')
  
  for script in soup.select('script, .hcdcrt, #ad_contentslot_1, #ad_contentslot_2'):
      script.extract()
  
  entry_name = soup.h2.text
  content1 = ''.join(map(str, soup.select_one('.cB cB-def dictionary biling').contents))
  </code></pre>
  <p>Then I got an error</p>
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-84-e9cb11cd6b5d&gt; in &lt;module&gt;
       10 
       11 entry_name = soup.h2.text
  ---&gt; 12 content1 = ''.join(map(str, soup.select_one('.cB cB-def dictionary biling').contents))
  
  AttributeError: 'NoneType' object has no attribute 'contents'
  </code></pre>
  <p>On the other hand, if I replace <code>cB cB-def dictionary biling</code> by <code>hom</code>, i.e. <code>content1 = ''.join(map(str, soup.select_one('.hom').contents))</code> then the code runs well. From below structure of the html, I think that <code>cB cB-def dictionary biling</code> and <code>hom</code> are very similar.</p>
  <p><a href="https://i.stack.imgur.com/LzSfJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LzSfJ.png" alt="enter image description here" /></a></p>
  <p>Could you please elaborate on how such problem arises and how to solve it?</p>