如何在scrapy-splash中设置启动超时?

Jho*_*ith 9 python scrapy scrapy-splash splash-js-render

我使用scrapy-splash来抓取网页,并在docker上运行splash服务.

commond:

docker run -p 8050:8050 scrapinghub/splash --max-timeout 3600
Run Code Online (Sandbox Code Playgroud)

但我得到了504错误.

"error": {"info": {"timeout": 30}, "description": "Timeout exceeded rendering page", "error": 504, "type": "GlobalTimeoutError"}
Run Code Online (Sandbox Code Playgroud)

虽然我尝试添加splash.resource_timeout,request:set_timeout或者SPLASH_URL = 'http://localhost:8050?timeout=1800.0'没有任何改变.

感谢帮助.

Tom*_*art 11

我使用scrapy-splash包并在args参数中设置超时SplashRequest如下:

yield scrapy_splash.SplashRequest(
    url, self.parse, endpoint='execute',
    args={'lua_source': script, 'timeout': 3600})
Run Code Online (Sandbox Code Playgroud)

这个对我有用.

  • 我从这个设置中得到了错误 400。我不知道为什么 (2认同)