写了个 tumblr 的视频爬虫,vpn 掉了后即使重新连上网速恢复了,下载速度还是零点几 KB,用什么办法让指定时间后自动重新开始这个 for 循环?
1
xpresslink 2018 年 5 月 29 日
import time
while True: ****for xxxx ********do xxx ****time.sleep(60) |
2
Rudefish OP @xpresslink 你写的这个 for 循环不执行完,time.sleep 应该不会执行吧
|
3
golmic 2018 年 5 月 29 日
while 1
start = now for if now - start > 60 break do |
6
lniwn 2018 年 5 月 29 日
aiohttp + asyncio.Timeout ?
|
7
bigpigeon 2018 年 5 月 30 日
我记得 python 的 req 模块有 timeout 参数的,用 scrapy 也应该有 timeout 参数的
|