resource_timeout属性用于设置加载的超时时间,单位是秒,如果设置为 0 代表不检测超时,如下,设置超时时间为 0.1 秒:

function main(splash)
  splash.resource_timeout = 0.1
  assert(splash:go('https://www.taobao.com/'))
  return splash:png()
end

执行之后抛出异常:

{
    "description": "Error happened while executing Lua script",
    "info": {
        "type": "LUA_ERROR",
        "source": "[string \"function main(splash)\r...\"]",
        "message": "Lua error: [string \"function main(splash)\r...\"]:3: network5",
        "error": "network5",
        "line_number": 3
    },
    "type": "ScriptError",
    "error": 400
}

 

 

 

 

 

 

    

相关文章:

  • 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
相关资源
相似解决方案