2020-04-28 09:34发布
[图]
第一种:
#滑到底部
js="varq=document.documentElement.scrollTop=100000"
driver.execut_script(js)
目前在firefox,chrome上验证都是可以跑通的
#滑动到顶部
js="varq=document.documentElement.scrollTop=0"
第二种
js="window.scrollTo(0,document.body.scrollHeight)"
driver.execute_script(js)
js="window.scrollTo(0,0)"
scrollHeight获取对象的滚动高度。 scrollLeft设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离。 scrollTop设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离。 scrollWidth获取对象的滚动宽度。
最多设置5个标签!
第一种:
#滑到底部
js="varq=document.documentElement.scrollTop=100000"
driver.execut_script(js)
目前在firefox,chrome上验证都是可以跑通的
#滑动到顶部
js="varq=document.documentElement.scrollTop=0"
driver.execut_script(js)
第二种
#滑到底部
js="window.scrollTo(0,document.body.scrollHeight)"
driver.execute_script(js)
目前在firefox,chrome上验证都是可以跑通的
#滑动到顶部
js="window.scrollTo(0,0)"
driver.execute_script(js)
scrollHeight获取对象的滚动高度。 scrollLeft设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离。 scrollTop设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离。 scrollWidth获取对象的滚动宽度。
一周热门 更多>