Answers for "How to get text of an element in Selenium WebDriver, without including child element text?"

0

How to get text of an element in Selenium WebDriver, without including child element text?

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
Posted by: Guest on August-17-2021

Code answers related to "How to get text of an element in Selenium WebDriver, without including child element text?"

Browse Popular Code Answers by Language