10

我使用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_timeoutor SPLASH_URL = 'http://localhost:8050?timeout=1800.0',但没有任何改变。

感谢帮助。

4

1 回答 1

12

我使用包并在参数中scrapy-splash设置超时,如下所示:argsSplashRequest

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

这个对我有用。

于 2017-06-19T10:55:57.730 回答