一 set_content()
1 点睛
用来设置页面内容。
2 代码
function main(splash)
assert(splash:set_content("<html><body><h1>hello</h1></body></html>"))
return splash:png()
end
3 效果
二 html()
1 点睛
获取网页的源代码。
2 代码
function main(splash, args)
splash:go("https://httpbin.org/get")
return splash:html()
end
3 效果
三 png()
1 点睛
获取PNG格式的网页截图。
2 代码
function main(splash, args)
splash:go("https://www.taobao.com")
return splash:png()
end
3 效果
<