
使用动作链:
from selenium.webdriver.common.keys import Keysfrom selenium.webdriver.common.action_chains import ActionChainsN = 5 # number of times you want to press TABactions = ActionChains(browser) for _ in range(N): actions = actions.send_keys(Keys.TAB)actions.perform()
或者,由于这是Python,因此您甚至可以执行以下 *** 作:
actions = ActionChains(browser) actions.send_keys(Keys.TAB * N)actions.perform()
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)