def _extractText(self, data, encoding):
    if self.isDebug:
        self._output('_extractText')
soup = BeautifulSoup.BeautifulSoup(data, fromEncoding=encoding)
comments = soup.findAll(text=lambda text: isinstance(text, BeautifulSoup.
    Comment))
[comment.extract() for comment in comments]
[script.extract() for script in soup.findAll('script')]
[css.extract() for css in soup.findAll('style')]
for textarea in soup.findAll('textarea'):
    textarea.string = self._extractText(textarea.renderContents(), 'UTF-8')
text = str('')
for line in soup.findAll(text=True):
    line = line.replace('\xc2\xa0', ' ').strip()
if line == '':
    continue
if line.startswith('doctype'):
    continue
if line.startswith('DOCTYPE'):
    continue
text = text + line + '\n'
return text
Как заставить BeautifulSoup анализировать содержимое тегов textarea как HTML?