【发布时间】:2020-09-02 22:42:51
【问题描述】:
大家好,
我正在尝试使用搜索框中的 send_keys 发送一些文本数据 附在图像中,但无法发送。给我错误。 目前重点是“简短描述”,需要移动 到搜索框并需要发送尝试使用发送文本信息 xpath 但没有帮助。 “Id”不断变化,所以它也不会 帮我。
search box is the textbox where im trying to send the text data
下面是我复制元素后得到的elemnet
<input id="5e3dc64a2f3010109e9a3c96f699b632_text" placeholder="Search" class="form-control" style="width: 150px;" name="5e3dc64a2f3010109e9a3c96f699b632_text" aria-describedby="5e3dc64a2f3010109e9a3c96f699b632_describedby">
下面是xpath:
//*[@id="5e3dc64a2f3010109e9a3c96f699b632_text"]
下面是我用来发送的部分代码
search_box = driver.find_element(By.XPATH, "//span[@class='form-control']")
search_box.click()
search_box.send_keys("Unable to access the shared folder")
【问题讨论】:
标签: python-3.x selenium selenium-webdriver automation servicenow