To send a character sequence to the element instead of visibility_of_element_located()
you need to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following Locator Strategy:
try:
browser.execute_script("window.scrollBy(0,600)", "")
WebDriverWait(browser, 60).until(EC.element_to_be_clickable((By.XPATH, path)))
comment = browser.find_element_by_xpath("//XPATH")
comment.send_keys(comments)
Note: You have to add the following imports :
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…