# -*- coding: utf-8 -*-

# Scrapy settings for maitian project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html BOT_NAME = 'maitian' SPIDER_MODULES = ['maitian.spiders']
NEWSPIDER_MODULE = 'maitian.spiders' #不能批量设置
# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = 'maitian (+http://www.yourdomain.com)' #默认遵守robots协议
# Obey robots.txt rules
ROBOTSTXT_OBEY = False #设置日志文件
LOG_FILE="maitian.log"
#日志等级分为5种:1.DEBUG 2.INFO 3.Warning 4.ERROR 5.CRITICAL
#等级越高 输出的日志越少
# LOG_LEVEL="INFO" #scrapy设置最大并发数 默认16
# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32 #设置批量延迟请求16 等待3秒再发16 秒
# Configure a delay for requests for the same website (default: 0)
# See https://doc.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16 #cookie 不生效 默认是True
# Disable cookies (enabled by default)
#COOKIES_ENABLED = False #远程
# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False #加载默认的请求头
# Override the default request headers:
#DEFAULT_REQUEST_HEADERS = {
# 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
# 'Accept-Language': 'en',
#} #爬虫中间件
# Enable or disable spider middlewares
# See https://doc.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
# 'maitian.middlewares.MaitianSpiderMiddleware': 543,
#} #下载中间件
# Enable or disable downloader middlewares
# See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
# 'maitian.middlewares.MaitianDownloaderMiddleware': 543,
#} # Enable or disable extensions
# See https://doc.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
# 'scrapy.extensions.telnet.TelnetConsole': None,
#} #在配置文件 开启管道
#优先级的范围 0--1000;值越小 优先级越高
# Configure item pipelines
# See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
#ITEM_PIPELINES = {
# 'maitian.pipelines.MaitianPipeline': 300,
#} # Enable and configure the AutoThrottle extension (disabled by default)
# See https://doc.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False # Enable and configure HTTP caching (disabled by default)
# See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = 'httpcache'
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'

Scrapy框架: settings.py设置的更多相关文章

  1. Scrapy框架: middlewares.py设置

    # -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in ...

  2. Scrapy框架: pipelines.py设置

    保存数据到json文件 # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your p ...

  3. Django settings.py设置 DEBUG=False后静态文件无法加载解决

    解决办法: settings.py 文件 DEBUG = False STATIC_ROOT = os.path.join(BASE_DIR,'static') #新增 urls.py文件(项目的) ...

  4. django的settings.py设置static

    DEBUG = True ################ STATICFILES ################ # A list of locations of additional stati ...

  5. django的settings.py设置session

    ############ # SESSIONS # ############ SESSION_CACHE_ALIAS = 'default' # Cache to store session data ...

  6. django 配置文件settings.py 设置模板

    INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'dj ...

  7. Django settings.py 的media路径设置

    转载自:http://www.xuebuyuan.com/676599.html 在一个 models 中使用 FileField 或 ImageField 需要以下步骤: 1. 在你的 settin ...

  8. Django之settings.py 的media路径设置

    在一个 models 中使用 FileField 或 ImageField 需要以下步骤: 1. 在你的 settings.py文件中, 定义一个完整路径给MEDIA_ROOT 以便让 Django在 ...

  9. Scrapy框架实战-妹子图爬虫

    Scrapy这个成熟的爬虫框架,用起来之后发现并没有想象中的那么难.即便是在一些小型的项目上,用scrapy甚至比用requests.urllib.urllib2更方便,简单,效率也更高.废话不多说, ...

随机推荐

  1. 教你如何创建vue环境

    教你如何创建vue的环境 wdnmd我操作了一万年,终于成功创建了vue的环境,现在就来讲一下,到底应该怎么操作才能成功创建vue的 第一步 : 我们应该做的不是别的,而是去官方网站下载文件 node ...

  2. RabbitMq--2--安装

    简单说下个人的理解,mq就是一个消息代理,负责异步消息转发,可以很大程度缓解服务器压力,并且防止服务器宕机影响业务等. 安装: 环境:centos7 1).首先需要安装erlang #wget htt ...

  3. Python基础篇(set集合)

    Python基础篇(set集合,深浅拷贝) set集合是Python的一个基本类型,一般是不常用.set中的元素是不重复的.无序的里边 的元素必须是可hash的比如int,str,tuple,bool ...

  4. wireshark简单的过滤条件

    http://blog.csdn.net/blue_jjw/article/details/8467885 一.IP过滤:包括来源IP或者目标IP等于某个IP比如:ip.src addr==192.1 ...

  5. java “+”运算

    /* 四则运算中加好“+”有常见的三种用法 1.对于数值来说,那就是加法 2.对于字符char来说,在计算之前char会被提升成为int 然后在计算 3.对于字符串String(首字母大写,并不是关键 ...

  6. js 输入整数

    1.我用 /^\+?[1-9][0-9]*$/ 貌似不对(小数也可以输入) 2.输入整数  n = /^[1-9]\d*$/; . -]\d*$/; //判断字符串是否为数字 if (!value) ...

  7. 【串线篇】SpringMvc视图解析

    一. 请求处理方法执行完成后,最终返回一个 ModelAndView 对象.对于那些返回 String,View 或 ModeMap 等类型的处理方法,Spring MVC 也会在内部将它们装配成一个 ...

  8. vue部分问题

    [color=#00b050]学 vue 的看过来,vue-cli 挺好用的,但是遇到具体情况还得做一部分调整和配置默认你已经成功启动 vue-cli 1.使用 scsscnpm i node-sas ...

  9. 最佳实践 | RDS & POLARDB归档到X-Pack Spark计算

    X-Pack Spark服务通过外部计算资源的方式,为Redis.Cassandra.MongoDB.HBase.RDS存储服务提供复杂分析.流式处理及入库.机器学习的能力,从而更好的解决用户数据处理 ...

  10. 理解webpack中的process.env.NODE_ENV

    参考资料 一. process 要理解 process.env.NODE_ENV 就必须要了解 process,process 是 node 的全局变量,并且 process 有 env 这个属性,但 ...