'Parses the raw document, cleans the text'

def set_pep_body(self):

    try:
        html = self.document.find('div', {'id': ['abstract', 'introduction', 'rationale', 'motivation', 'what-is-a-pep', 'overview', 'improving-python-zip-application-support', 'scope', 'abstract-and-rationale', 'rationale-and-goals', 'specification']})
        if (html is None):
            raise AttributeError
        html = FHTEMPLATE.format(information=str(html), title=self.long_title)
        html = html.rstrip().replace(' DCTB ', '                ')
        html = re.sub(re.compile('\\[\\d+\\]'), '', html)
        html = re.sub(re.compile('<h1>((.|\n)+?)</h1>'), '', html)
        html = html.replace('<pre    class="literal-block">', '<pre><code>')
        html = html.replace('</pre>', '</code></pre>')
        html = html.replace('<tt    class="docutils    literal">', '<code>')
        html = html.replace('</tt>', '</code>')
        soup = BeautifulSoup(html, 'html.parser')
        for match in soup.findAll(['div']):
            match.unwrap()
        for match in soup.findAll(['a']):
            match.unwrap()
        html = soup.contents[0]
        html = str(html)
        html = re.sub(re.compile('\n'), '\\n', html)
        html = re.sub('<p>[\\n\\s]+<p>[\\n\\s]*|<(\\/)p>[\\n\\s]+<\\/p>[\\n\\s]*', '<\\1p>', html)
        self.body = repr(html).replace("'", '')
        print ('>>' * 20)
        print self.body
        print ('<<' * 20)
    except AttributeError:
        self.body = ''
    except:
        print ('Parse    Error:    Investigate    ' + self.pep)
