Selenium - 向下箭头和输入不可能吗?

Selenium - arrow Down and Enter not possible?

我尝试使用以下代码自动化站点 -

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
import time

link = "https://www.bcassessment.ca/"
options = Options()
options.add_argument("start-maximized")
options.add_argument('window-size=1920x1080')                                 
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
srv=Service(ChromeDriverManager().install())
driver = webdriver.Chrome (service=srv, options=options)    
waitWebDriver = WebDriverWait (driver, 10)    
driver.get (link)        
waitWebDriver.until(EC.element_to_be_clickable( \
  (By.XPATH, "//input[@id= 'rsbSearch']"))).send_keys("106 Maple")          
driver.find_element(By.XPATH, "//input[@id= 'rsbSearch']").send_keys(Keys.ARROW_DOWN)      
driver.find_element(By.XPATH, "//input[@id= 'rsbSearch']").send_keys(Keys.ENTER)      
time.sleep(500) 

该字段的文本输入工作正常 - 但随后必须按向下键,然后按 Return 键才能获得搜索结果。但这不适用于 Selenium。

为什么会这样,我需要做什么才能得到搜索结果(例如,按下并输入)?

我看到手动输入搜索字符串后,您需要点击搜索输入,然后按向下箭头,等待出现建议的结果,然后再次按下键,然后按回车键。
另外,我看到 所以请试试这个,它应该有效

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
import time

link = "https://www.bcassessment.ca/"
options = Options()
options.add_argument("start-maximized")
options.add_argument('window-size=1920x1080')                                 
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
srv=Service(ChromeDriverManager().install())
driver = webdriver.Chrome (service=srv, options=options)    
waitWebDriver = WebDriverWait (driver, 10)    
driver.get (link)        
waitWebDriver.until(EC.element_to_be_clickable( \
  (By.XPATH, "//input[@id= 'rsbSearch']"))).send_keys("106 Maple")          
searc_input = driver.find_element(By.XPATH, "//input[@id= 'rsbSearch']")
searc_input.click()
time.sleep(0.1) 
searc_input.send_keys(Keys.ARROW_DOWN)      
time.sleep(0.4) 
searc_input.send_keys(Keys.ARROW_DOWN)      
time.sleep(0.4) 
searc_input.send_keys(Keys.ENTER)