scrapy-redis

作者: 兔头咖啡 | 来源:发表于2018-03-27 14:07 被阅读0次

settings配置redis:

SCHEDULER = "scrapy_redis.scheduler.Scheduler"
SCHEDULER_PERSIST = True
SCHEDULER_QUEUE_CLASS = 'scrapy_redis.queue.SpiderPriorityQueue'
DUPEFILTER_CLASS = "scrapy_redis.dupefilter.RFPDupeFilter"
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379

爬虫修改:

class NovelSpider(RedisSpider):
    name = 'novel2'
    redis_key = 'novel2:start_urls'
    start_urls = ['http://www.daomubiji.com/']

相关文章

网友评论

    本文标题:scrapy-redis

    本文链接:https://www.haomeiwen.com/subject/myftkxtx.html