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