Time 模块 Time.sleep(秒数):可以让程序休眠多少秒,爬虫时设置休眠的时间间隔,可以减少服务器的压力,避免被反爬虫。 import time i = 1 while i <= 3: print i # 输出i i += 1 time.sleep(1) # 休眠1秒