[英]How to set splash timeout in scrapy-splash?
我使用scrapy-splash来抓取网页,并在docker上运行splash 服务。
共同点:
docker run -p 8050:8050 scrapinghub/splash --max-timeout 3600
但是我收到了 504 错误。
"error": {"info": {"timeout": 30}, "description": "Timeout exceeded rendering page", "error": 504, "type": "GlobalTimeoutError"}
尽管我尝试添加splash.resource_timeout
、 request:set_timeout
或SPLASH_URL = 'http://localhost:8050?timeout=1800.0'
,但没有任何改变。
谢谢你的帮助。
我使用scrapy-splash
包并在SplashRequest
args
参数中设置超时,如下所示:
yield scrapy_splash.SplashRequest(
url, self.parse, endpoint='execute',
args={'lua_source': script, 'timeout': 3600})
它对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.