Splash go, 方法

go()方法用来请求某个链接,而且它可以模拟 GET 和 POST 请求,同时支持传入请求头、表单等数据

function main(splash)                        
  ok, reason = splash:go("http://www.baidu.com")    # 默认使用GET请求,返回结果是结果和原因的组合,如果ok为空,则reason变量中会包含错误的原因
  ok, reason = splash:go("http://www.baidu.com", baseurl=nil, headers=nil, http_method="GET", body=nil, formdata=nil)   # 也可以传入请求头或表单数据
  ok, reason = splash:go("http://www.baidu.com", http_method="POST", body=nil)   # 使用POST请求
  if ok then
    return splash:html()
  end
 end