I'm trying to read some messages in Discord with selenium, but there a specific one that the webdriver seems unable to read.
chat_messages = browser.find_elements(By.CLASS_NAME, "markup-eYLPri")
for chat_message in chat_messages:
print(chat_message.get_property("textContent"))
I have tried with:
element.get_property("textContent")
element.get_property("innerText")
element.text
All of them return an empty string.
However, in the browser, I've tried running this javascript snippet:
e = document.getElementById("message-content-1008775068500893826")
e.innerText
e.textContent
And, they did print the text as expected.
Is there anything I am missing?