码迷,mamicode.com
首页 > 其他好文 > 详细

selenium,滚到页面底部的方法

时间:2019-11-16 17:54:49      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:style   asc   height   如何   win   pre   span   页面   sele   

你可以用 execute_script方法来处理这个。 调用原生javascript的API,这样你想滚到哪里就能滚到哪里。
 
下面的代码演示了如何滚到页面的最下面:
 
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") 

 

selenium,滚到页面底部的方法

标签:style   asc   height   如何   win   pre   span   页面   sele   

原文地址:https://www.cnblogs.com/becks/p/11872470.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!