黑松山资源网 Design By www.paidiu.com
scrapy项目 setting.py
#Resis 设置 #使能Redis调度器 SCHEDULER = 'scrapy_redis.scheduler.Scheduler' #所有spider通过redis使用同一个去重过滤器 DUPEFILTER_CLASS = 'scrapy_redis.dupefilter.RFPDupeFilter' #不清除Redis队列、这样可以暂停/恢复 爬取 #SCHEDULER_PERSIST = True #SCHEDULER_QUEUE_CLASS ='scrapy_redis.queue.PriorityQueue' #默认队列,优先级队列 #备用队列。 #SCHEDULER_QUEUE_CLASS ='scrapy_redis.queue.FifoQueue' #先进先出队列 #SCHEDULER_QUEUE_CLASS ='scrapy_redis.queue.LifoQueue' #后进先出队列 #最大空闲时间防止分布式爬虫因为等待而关闭 #SCHEDULER_IDLE_BEFORE_CLOSE = 10 #将抓取的item存储在Redis中以进行后续处理。 ITEM_PIPELINES = { 'scrapy_redis.pipelines.RedisPipeline':300, } # The item pipeline serializes and stores the items in this redis key. #item pipeline 将items 序列化 并用如下key名储存在redis中 #REDIS_ITEMS_KEY = '%(spider)s:items' #默认的item序列化方法是ScrapyJSONEncoder,你也可以使用自定义的序列化方式 #REDIS_ITEMS_SERIALIZER = 'json.dumps' #设置redis地址 端口 密码 REDIS_HOST = 'localhost' REDIS_HOST = 6379 #也可以通过下面这种方法设置redis地址 端口和密码,一旦设置了这个,则会覆盖上面所设置的REDIS_HOST和REDIS_HOST REDIS_URL = 'redis://root:redis_pass@xxx.xx.xx.xx:6379' #root用户名,redis_pass:你设置的redis验证密码,xxxx:你的主机ip #你设置的redis其他参数 Custom redis client parameters (i.e.: socket timeout, etc.) REDIS_PARAMS = {} #自定义的redis客户端类 #REDIS_PARAMS['redis_cls'] = 'myproject.RedisClient' # If True, it uses redis ``zrevrange`` and ``zremrangebyrank`` operation. You have to use the ``zadd`` # command to add URLS and Scores to redis queue. This could be useful if you # want to use priority and avoid duplicates in your start urls list. #REDIS_START_URLS_AS_SET = False # 默认的RedisSpider 或 RedisCrawlSpider start urls key #REDIS_START_URLS_KEY = '%(name)s:start_urls' #redis的默认encoding是utf-8,如果你想用其他编码可以进行如下设置: #REDIS_ENCODING = 'latin1'
类scrapy_redis.spiders.RedisSpider使spider可以从redis数据库中读取URL。Redis队列中的URL将被爬取,如果第一个请求产生更多请求,则spider将处理这些请求,然后再从Redis中获取另一个URL。
创建spider
from scrapy_redis.spiders import RedisSpider class MySpider(RedisSpider): name = 'myspider' def parse(self, response): # do stuff pass
在redis-cli设置start_url
redis-cli lpush myspider:start_urls http://google.com
黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年10月05日
2024年10月05日
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]