下载
- Reids:https://github.com/MicrosoftArchive/redis
- scrapy-redis:https://github.com/rmax/scrapy-redis
- redis-py:> pip install redis
- python:3.5
根据scrapy-redis的Usage,将下面设置添加到setting.py
- SCHEDULER = "scrapy_redis.scheduler.Scheduler"
- DUPEFILTER_CLASS = "scrapy_redis.dupefilter.RFPDupeFilter"
- ITEM_PIPELINES = {
'scrapy_redis.pipelines.RedisPipeline': 300
}
在spider.py上设置 name 和 redis_key;启动redis-server、redis-cli和pycharm,可以看到scapy在等待start_urls
2018-01-26 14:07:56 [scrapy.extensions.telnet] DEBUG: Telnet console listening on 127.0.0.1:6023
- 在redis-cli上 llpush [redis_key] [start_urls]
salver机上的配置与master无异,连接参考http://www.cnblogs.com/kylinlin/p/5198233.html