Selenium Python将密钥发送到输入ID

Selenium Python将密钥发送到输入ID,python,selenium,webdriver,Python,Selenium,Webdriver,使用Python27: 我正在尝试使用beautifulsoup自动执行搜索和提取方法,以便在此数据库服务器上解析和输入数据。到目前为止,我已经设法让Python登录到它。但是现在当我试图搜索输入元素进行搜索时,我似乎无法获得正确的标识符/代码 以蓝色突出显示的代码表示: <input id="QUICKSEARCH_STRING" type="text" on focus="setTimeout('focusSearchElem()',100... 我不确定我错在哪里,但我想我已经接

使用Python27:

我正在尝试使用beautifulsoup自动执行搜索和提取方法,以便在此数据库服务器上解析和输入数据。到目前为止,我已经设法让Python登录到它。但是现在当我试图搜索输入元素进行搜索时,我似乎无法获得正确的标识符/代码

以蓝色突出显示的代码表示:

<input id="QUICKSEARCH_STRING" type="text" on focus="setTimeout('focusSearchElem()',100...
我不确定我错在哪里,但我想我已经接近了

browser.按\u id查找\u元素('search\u panel')

我没有看到任何带有
id=“search\u panel”
的元素

以下是我如何定位所需的输入元素:

browser.find_element_by_id("QUICKSEARCH_STRING")
browser.find_element_by_css_selector("div.search_panel input#QUICKSEARCH_STRING")

登录后,您可能需要:

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

wait = WebDriverWait(driver, 10)

search_input = wait.until(EC.presence_of_element_located((By.ID, "QUICKSEARCH_STRING")))
search_input.send_keys('blahblahblah')

我在你发布的代码中没有看到任何对BeautifulSoup的引用,应该有吗?
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

wait = WebDriverWait(driver, 10)

search_input = wait.until(EC.presence_of_element_located((By.ID, "QUICKSEARCH_STRING")))
search_input.send_keys('blahblahblah')