缓存 python 个 Web 请求以供离线使用
Caching python web requests for offline use
有没有办法 "cache" 我用 python "requests" 模块发出的请求,即使我离线,模块仍然 returns网页就像我在线一样?我怎样才能实现这样的目标?目前我只找到了只缓存网页的缓存库,但你仍然必须在线...
我认为你可以使用 request_cache 可用的模块。
请检查http://requests-cache.readthedocs.org/en/latest/user_guide.html
使用 request_cache 缓存后,即使断开连接,数据也可用。
对于其他搜索者,执行该工作的模块称为 "vcrpy"。
有没有办法 "cache" 我用 python "requests" 模块发出的请求,即使我离线,模块仍然 returns网页就像我在线一样?我怎样才能实现这样的目标?目前我只找到了只缓存网页的缓存库,但你仍然必须在线...
我认为你可以使用 request_cache 可用的模块。
请检查http://requests-cache.readthedocs.org/en/latest/user_guide.html
使用 request_cache 缓存后,即使断开连接,数据也可用。
对于其他搜索者,执行该工作的模块称为 "vcrpy"。