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

 

.

 

 

 

 

    

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-08
  • 2021-06-13
  • 2022-01-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案