0

I have this piece of code:

f=driver.find_element_by_css_selector("textarea._bilrf")
(driver.execute_script("arguments[0].value = arguments[1]", f, "Hi!"))

The word "Hi!" is sent in the box. But, I could not press ENTER to send it. It is notifiable that send_keys() and submit() doesn't work in my code.

Hamed Baziyad
  • 1,954
  • 5
  • 27
  • 40

1 Answers1

2

Try this code:

from selenium.webdriver.common.keys import Keys
driver.find_element_by_xpath("""//*[@id="react-root"]/section/main/div/div/article/div[2]/section[1]/a[2]/span""").click()
driver.find_element_by_css_selector("textarea._bilrf").send_keys("Hi!", Keys.ENTER)