selenium键盘,鼠标用法
作者:互联网
导入类:from selenium.webdriver.common.keys import Keys
键盘模拟组合键
上下左右键:Keys.DOWN, Keys.UP, Keys.LEFT, Keys.RIGHT
回车和换行键:Keys.ENTER, Keys.RETURN
Keys.HOME, Keys.END, Keys.PAGE_DOWN, Keys.PAGE_SPACE,Keys.PAGE_UP, Keys.Esc
Keys.F1, Keys.F2, Keys.F3...., Keys.F12
Keys.TAB, Keys.CONTROL
鼠标事件
导入类:from selenium.webdriver.commom.action_chains import ActionChains
右击:context_click()
双击:double_click()
悬停:move_to_element()
拖动:drag_and_drop()
执行:perform()
执行所有ActionChains中存储的行为,可理解为对整个操作的提交动作
click_element = driver.find_element_by_link_text('音乐')
ActionChains(driver).context_click(click_element).perform()
标签:鼠标,Keys,selenium,element,键盘,ActionChains,PAGE,click 来源: https://www.cnblogs.com/nailao/p/16329788.html