首页 > 解决方案 > Selenium 与 Python - send_keys 输入文本但随后立即清除文本.....不知道为什么

问题描述

我希望有人能帮帮忙。我什么都试过了。首先,我根本无法输入文本,并意识到我必须先切换到框架(没有 id 或名称,所以我必须使用索引 4)。

然后我可以看到文本被输入到我的所有字段中,然后很快被清除。我的代码中没有任何东西可以做到这一点。

有人知道如何解决这种行为吗?

driver.switch_to.frame(4)
driver.implicitly_wait(5)
driver.find_element_by_name("ctl00$Content$ucxList$txtSearchByTextSearchByEventExRef").send_keys("bump this up!");
driver.implicitly_wait(5)
driver.find_element_by_name("ctl00$Content$ucxList$txtSearchByTextSearchByEventName").send_keys("bump this up!");

`

标签: python-3.xseleniumselenium-webdriverweb-scraping

解决方案


推荐阅读