selenium

3.1 1.清除输入框已有的字符串

element.clear()

3.2 2.要求在输入框中填入姓名:xxx。

element = wd.find_element(By.ID, "input1")

element.clear() # 清除输入框已有的字符串
element.send_keys('xxx') # 输入新字符串
posted @ 2025-03-06 16:03  布丁家的苏苏  Views(11)  Comments(0)    收藏  举报