selenium 自动化滑动条的操作

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()

你可能感兴趣的:(selenium 自动化滑动条的操作)