import bs4
node = bs4.BeautifulSoup('<html><div>A<span>B</span>C</div></html>').find('div'
    )
print(''.join([t for t in node.contents if type(t) == bs4.element.
    NavigableString]))
Only extracting text from this element, not its children