I'm developing an Instagram bot with python.I want to comment on a post.the code I use is as follows
Code
textarea = self.driver.find_element_by_css_selector("textarea.Ypffh")
textarea.send_keys("TEST comment")
textarea.send_keys(Keys.ENTER)
Error Message:
Message: Element <textarea class="Ypffh focus-visible"> is not reachable by keyboard
To understand the problem, I made a sample comment using the following code with the browser console log and added it to the text field. However, even though the comment appears on the screen, the text field is not added as a value in the text field and is deleted when the text field is focused.
document.querySelector("textarea.Ypffh").value="Hey!"
As a result of the examination, when the focus is made to the textarea element, the "focus-visible" class is added to the textarea element and the data-focus-visible-added attr is added.I added classes and attr with the codes below, but nothing changed.
document.querySelector("textarea.Ypffh").classList.add("focus-visible")`
document.querySelector("textarea.Ypffh").setAttribute("data-focus-visible-added","")
In short, I can not comment in any way with javascript or console log.