title: How can i grab CData out of BeautifulSoup
body: <p>I have a website that I'm scraping that has a similar structure the following. I'd like to be able to grab the info out of the CData block. </p>
  
  <p>I'm using BeautifulSoup to pull other info off the page, so if the solution can work with that, it would help keep my learning curve down as I'm a python novice.
  Specifically, I want to get at the two different types of data hidden in the CData statement. the first which is just text I'm pretty sure I can throw a regex at it and get what I need. For the second type, if i could drop the data that has html elements into it's own beautifulsoup, I can parse that. </p>
  
  <p>I'm just learning python and beautifulsoup, so I'm struggling to find the magical incantation that will give me just the CData by itself.</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;  
  &lt;head&gt;  
  &lt;title&gt;
     Cows and Sheep
    &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
   &lt;div id="main"&gt;
    &lt;div id="main-precontents"&gt;
     &lt;div id="main-contents" class="main-contents"&gt;
      &lt;script type="text/javascript"&gt;
         //&lt;![CDATA[var _ = g_cow;_[7654]={cowname_enus:'cows rule!',leather_quality:99,icon:'cow_level_23'};_[37357]={sheepname_enus:'baa breath',wool_quality:75,icon:'sheep_level_23'};_[39654].cowmeat_enus = '&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;b class="q4"&gt;cows rule!&lt;/b&gt;&lt;br&gt;&lt;/br&gt;
         &lt;!--ts--&gt;
         get it now&lt;table width="100%"&gt;&lt;tr&gt;&lt;td&gt;NOW&lt;/td&gt;&lt;th&gt;NOW&lt;/th&gt;&lt;/tr&gt;&lt;/table&gt;&lt;span&gt;244 Cows&lt;/span&gt;&lt;br&gt;&lt;/br&gt;67 leather&lt;br&gt;&lt;/br&gt;68 Brains
         &lt;!--yy--&gt;
         &lt;span class="q0"&gt;Cow Bonus: +9 Cow Power&lt;/span&gt;&lt;br&gt;&lt;/br&gt;Sheep Power 60 / 60&lt;br&gt;&lt;/br&gt;Sheep 88&lt;br&gt;&lt;/br&gt;Cow Level 555&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
         &lt;!--?5695:5:40:45--&gt;
         ';
          //]]&gt;
        &lt;/script&gt;
       &lt;/div&gt;
       &lt;/div&gt;
      &lt;/div&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>