在搜索框中插入一个值,然后 select 下拉选项

Insert an value in the search box and select the dropdown option

任何人都可以指导我如何通过 selenium 处理以下情况。

预期工作流程:系统应自动在搜索框中键入“125”并select值“患者 ID”

如果此 ID 是唯一的:

searchinput

您可以使用以下代码发送125

wait = WebDriverWait(driver, 10)
wait.until(EC.visibility_of_element_located((By.ID, "searchinput"))).send_keys('125')

进口:

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC

更新 1:

driver.switch_to.frame(driver.find_element_by_id("frame id"))
#then interact with `searchinput`