title: Using BeautifulSoup to Extract CData
body: <p>I'm trying to use BeautifulSoup from bs4/Python 3 to extract CData. However, whenever I search for it using the following, it returns an empty result. Can anyone point out what I'm doing wrong?</p>
  
  <pre><code>from bs4 import BeautifulSoup,CData
  
  txt = '''&lt;foobar&gt;We have
           &lt;![CDATA[some data here]]&gt;
           and more.
           &lt;/foobar&gt;'''
  soup = BeautifulSoup(txt)
  for cd in soup.findAll(text=True):
      if isinstance(cd, CData):
          print('CData contents: %r' % cd)
  </code></pre>