You can get the div
text just not recursively retrieving the children texts:
>>> from bs4 import BeautifulSoup
>>> soup = BeautifulSoup('<div><b>ignore this</b>get this</div>')
>>> soup.div.find(text=True, recursive=False)
u'get this'
This works independently of the position of the text with respect of the children:
>>> soup = BeautifulSoup('<div>get this<b>ignore this</b></div>')
>>> soup.div.find(text=True, recursive=False)
u'get this'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…