def get_true_text(tag):
    children = tag.find_elements_by_xpath('*')
original_text = tag.text
for child in children:
    original_text = original_text.replace(child.text, '', 1)
return original_text
How to get text of an element in Selenium WebDriver (via the Python api) without including child element text?