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