擅长:python、mysql、java
<p>您可能需要检查找到的元素的大小,以确保您确实找到了一些东西。在</p>
<p>如果您正在使用firefox,这可能会妨碍您:
<a href="https://stackoverflow.com/questions/9505588/selenium-webdriver-is-clearing-out-fields-after-sendkeys-had-previously-populate">selenium webdriver is clearing out fields after sendKeys had previously populated them</a></p>
<p>或者一些javascript可能在你的键被发送后在这个字段中大吃特吃(可能是页面加载后一些js启动)。在</p>
<p>您还可以尝试先调用click(),然后发送按键,如果是上面提到的问题或类似的问题,这可能有助于集中元素。在</p>