selenium清空元素时,.clear不执行

应该是由于鼠标焦点没有定位到相应元素

driver.find_element_by_xpath('//input[@type="password"]').click()
driver.find_element_by_xpath('//input[@type="password"]').clear()
driver.find_element_by_xpath('//input[@type="password"]').send_keys(newpass)

可以先执行 click定位到相应元素

posted @ 2017-12-01 14:55  xqnq2007  阅读(2005)  评论(0编辑  收藏  举报