zoukankan      html  css  js  c++  java
  • scrapy-redis让redis不止使用db0

    废话不多说,直接在  custom_settings 设置即可

    代码:

     1 class MySpider(RedisSpider):
     2     """Spider that reads urls from redis queue (myspider:start_urls)."""
     3     name = 'xxxx'
     4     redis_key = 'xxxx:start_urls'
     5 
     6     # ……
     7     custom_settings = {
     8         'LOG_LEVEL': 'DEBUG',
     9         'DOWNLOAD_DELAY': 0,
    10 
    11         # 指定redis数据库的连接参数
    12         'REDIS_HOST': '192.168.1.99',
    13         'REDIS_PORT': 6379,
    14 
    15         # 指定 redis链接密码,和使用哪一个数据库
    16         'REDIS_PARAMS' : {
    17             'password': 'redisPasswordTest123456',
    18             'db': 2
    19         },
    20     }
  • 相关阅读:
    二叉堆(最小堆, 最大堆)介绍与实现
    C++ 用变量定义数组
    C++ 用变量定义数组
    053185
    053184
    053183
    053182
    053181
    053180
    oracle prior
  • 原文地址:https://www.cnblogs.com/ltn26/p/10120250.html
Copyright © 2011-2022 走看看