Tried to execute this script in selenium Python 4.7.2 with this line of code:
driver.execute_script('document.querySelector(".ck-placeholder").innerHTML = "TEST";')
I have checked DevTools, and the element does exist.
When running the code over this error appears:
selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot set properties of null (setting 'innerHTML')
I am trying to make a automatic messager bot that sends messages in Microsoft Teams via Selenium Python. I do know that there are other ways to send messages via apis, eg. but I want to learn Seleneium via this project.
The element: .ck-placeholder
is the input field of Microsoft Teams (Messaging).
Here is the GitHub: https://github.com/LucasoDevDotTk/automatic_login_microsoft, send_msg.py is the file I'm working on
Expected results:
innerHTML of .ck-placeholder
to be replaced with "TEST"
Possible Causes: I havent checked if this is correct but .ck-placeholder
is placed in an iframe, may this be the issue?