My case is simple, I just want to take the text from this html bellow:
<yt-formatted-string id="text" title="" class="style-scope ytd-channel-name">Rayra Fortunato</yt-formatted-string>
I'm using Python + Selenium but i can't retrieve the "Rayra Fortunato" from it as a string.
This is my code that isn't working properly.
realName = driver.find_element_by_xpath("//yt-formatted-string[contains(text(),'Rayra Fortunato')]")
realName = realName.get_attribute('text')
print(realName)
or
realName = driver.find_element_by_xpath("//yt-formatted-string[contains(text(),'Rayra Fortunato')]")
realName = realName.text
print(realName)
Any help?
Thanks!
Rayra Fortunatois expected output?'