extracting element and insert a space
Use getText
instead:
import BeautifulSoup
soup=BeautifulSoup.BeautifulSoup('<html>this<b>is</b>example</html>')
print soup.getText(separator=u' ')
# u'this is example'
If your version of Beautifulsoup does not have getText
then you could do this:
In [26]: ' '.join(soup.findAll(text=True))
Out[26]: u'this is example'