Splash scroll_position 属性

scroll_position属性用于控制页面上下或左右滚动,如下,表示控制页面向下滚动 400 像素值并返回结果图,

function main(splash, args)
  assert(splash:go('https://www.baidu.com/'))
  splash.scroll_position = {y=400}
  return splash:png()
end

如果要让页面左右滚动,可以传入 x 参数:

function main(splash, args)
  assert(splash:go('https://www.baidu.com/'))
  splash.scroll_position = {x=100, y=200}
  return splash:png()
end

 

.

 

 

 

 

    

posted @ 2019-03-18 15:24  孔雀东南飞  阅读(375)  评论(0编辑  收藏  举报