Get text without inner tags text in selenium Code Example
Get text without inner tags text in selenium
data = '''
Other Financial Services1
'''
from bs4 import BeautifulSoup
import bs4
soup = BeautifulSoup(data, 'html.parser')
external_span = soup.find('td')
text = []
for x in external_span:
if isinstance(x, bs4.element.NavigableString):
text.append(x.strip())
print(" ".join(text))