我爱编程

selenium 自动化滑动条的操作

2018-03-24  本文已影响0人  放开那个电扇

b= ActionChains(driver)

c= driver.find_element_by_xpath("元素名")

b.click_and_hold(c).perform()

for iin range(100):

    try:

          b.move_by_offset(15,0).perform()

    except Exception:

          break #此处可以根据需求来跳出循环

    b.reset_actions()

上一篇 下一篇

猜你喜欢

热点阅读