动态操作滚动条

1、先定位到元素,在移动到元素位置
# 描述元素的属性
target = driver.find_element_by_css_selector("img[title=‘Download AutoIt‘]")
# 执行js脚本,拖动浏览器滚动条到元素的位置
driver.execute_script("arguments[0].scrollIntoView();", target)
2、使用window.scrollTo(x,y)
driver.execute_script("window.scrollTo(0,0)")
原文地址:https://www.cnblogs.com/xinjing-jingxin/p/9328949.html