How to Scrolldwon a web page using htmlunit or PanthomJS

坚强是说给别人听的谎言 提交于 2019-12-24 08:28:21

问题


I have a web page which continues to loading the contents when ONLY scrolling down the page.

So I want a way to scroll down the page pragmatically using HtmlUnit or PanthomJS.

  1. Can I imitate the scroll down action(lets think using scroll element). or
  2. Can i imitate it using j script.

if this can do please explain the way.

Thanks.


回答1:


You can set InnerHeight a large value. like this:

webClient.getCurrentWindow().setInnerHeight(60000);

the webcontrol will load all element,because of the webcontrol enough heigt.



来源:https://stackoverflow.com/questions/13779369/how-to-scrolldwon-a-web-page-using-htmlunit-or-panthomjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!