简单元素操作.py
#清除文本:clear()#模拟按键输入:send_keys(*value)#点击元素:click()#回车/提交表单:submit()#获取输入框尺寸:from selenium import webdriverdriver = webdriver.Chrome()size = driver.find_element_by_id("kw").size#获取元素的文本信息:text = driver.find_element_by_id("cp").text#获取属性值:attribute = driver.find_element_by_id("kw").get_attribute("type")#返回元素的结果是否可见、结果为true或false:result = driver.find_element_by_id("kw").is_displayed()
相关推荐
wikiwater 2020-10-27
IdeaElements 2020-08-19
Sophiego 2020-08-16
Kakoola 2020-08-01
Kakoola 2020-07-29
ELEMENTS爱乐冬雨 2020-07-18
ELEMENTS爱乐小超 2020-07-04
ELEMENTS爱乐小超 2020-07-04
Kakoola 2020-06-28
Feastaw 2020-06-18
Wmeng0 2020-06-14
ELEMENTS爱乐冬雨 2020-06-14
云之高水之远 2020-06-14
哈喽elements 2020-06-14
Feastaw 2020-06-11