selenium web element is found but printing empty space code example
Example: selenium text returns empty string python
new_name = driver.find_element_by_xpath(xp_name).get_attribute('textContent')
new_name = driver.find_element_by_xpath(xp_name).get_attribute('textContent')