直接上代码
1 #!/usr/bin/env python 2 # -*- encoding: utf-8 -*- 3 # Created on 2017-10-27 09:56:50 4 # Project: redis_test 5 6 from pyspider.libs.base_handler import * 7 import redis 8 9 class Handler(BaseHandler): 10 crawl_config = { 11 } 12 13 @every(minutes=24 * 60) 14 def on_start(self): 15 r = redis.Redis(host='ip',port=6380,db=0) 16 r.set('wang','zhi')