我使用scrapy-splash抓取网页,并在docker上运行splash服务。
commond:
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',但没有任何变化。
谢谢你的帮助。
发布于 2017-06-19 18:55:58
我使用scrapy-splash包,在SplashRequest的args参数中设置超时,如下所示:
yield scrapy_splash.SplashRequest(
url, self.parse, endpoint='execute',
args={'lua_source': script, 'timeout': 3600})这对我很管用。
https://stackoverflow.com/questions/44627694
复制相似问题