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  

 

 

 

 

 

     

相关文章:

  • 2021-06-23
  • 2021-11-05
  • 2021-11-23
  • 2021-12-10
  • 2021-09-23
  • 2021-05-17
  • 2022-02-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
相关资源
相似解决方案