赞
踩
例:
from selenium import webdriver
b = webdriver.Firefox()
b.get("http://edu.51cto.com/courselist/index.html")
ele = b.find_element_by_tag_name("input") #定位找输入框
from selenium.webdriver.common.keys import Keys
ele.send_keys("python123") #在输入框中输入
ele.send_keys(Keys.BACK_SPACE3) #在输入框中回删三个字符
ele.send_keys(Keys.CONTRL,"a") #输入框中的内容全选
ele.send_keys(Keys.CONTRL,"x") #剪切
ele.send_keys(Keys.CONTRL,"v") #粘贴
转载于:https://blog.51cto.com/1126228/2052162
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。