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

# Scrapy settings for maoyan 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 # #Scrapy项目的名字,这将用来构造默认 User-Agent
BOT_NAME = 'BLZX' SPIDER_MODULES = ['BLZX.spiders'] # Scrapy搜索spider的模块列表 默认: [xxx.spiders]
NEWSPIDER_MODULE = 'BLZX.spiders' # 使用 genspider 命令创建新spider的模块。默认: 'xxx.spiders' # 通过在用户代理上标识您自己(和您的网站)来负责地爬行
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'maoyan (+http://www.yourdomain.com)' # Obey robots.txt rules 遵守robots.txt规则
ROBOTSTXT_OBEY = False # 配置Scrapy执行的最大并发请求(默认值:16)
# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32 # 同一网站的请求配置延迟(默认值:0)
# 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 # 对单个IP进行并发请求的最大值 # 禁用cookie(默认情况下启用)
# Disable cookies (enabled by default)
#COOKIES_ENABLED = False # 禁用telnet控制台(默认启用)
# 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 Middleware=============================
#SPIDER_MIDDLEWARES = {
# 'maoyan.middlewares.MaoyanSpiderMiddleware': 543,
#} # 启用或禁用下载器中间件
# Enable or disable downloader middlewares
# See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html # =====================Downloader Middleware===========================
# DOWNLOADER_MIDDLEWARES = {
# 'maoyan.middlewares.MaoyanDownloaderMiddleware': 543,
# } # 启用或禁用扩展
# Enable or disable extensions
# See https://doc.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
# 'scrapy.extensions.telnet.TelnetConsole': None,
#} # 管道配置项目
# Configure item pipelines
# See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
#ITEM_PIPELINES = {
# 'maoyan.pipelines.MaoyanPipeline': 300,
#} # 启用和配置AutoThrottle扩展(默认情况下禁用)
# 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 # Scrapy平均请求数应与每个远程服务器并行发送
# 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 # 启用和配置HTTP缓存(默认情况下禁用)
# 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文件详解的更多相关文章

  1. 第十九节:Scrapy爬虫框架之Middleware文件详解

    # -*- coding: utf-8 -*- # 在这里定义蜘蛛中间件的模型# Define here the models for your spider middleware## See doc ...

  2. scrapy爬虫框架配置--settings

    我们可以用一个settings.py做个简单的介绍和解析:例: ----> # -*- coding: utf-8 -*- # Scrapy settings for xigua project ...

  3. 【转】Python3使用Django2.x的settings文件详解

    # -*- coding:utf8 -*- import os # 项目路径 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__ ...

  4. ectouch第十讲 之ecshop中 dwt, lbi 文件详解

    原文:http://www.yunmoban.cn/article-241.html Ecshop包括的文件夹有admin.api.cert.data.images.includes.js. lang ...

  5. Scrapy爬虫框架补充内容一(Linux环境)

    Scrapy爬虫框架结构及工作原理详解 scrapy框架的框架结构如下: 组件分析: ENGINE:(核心):处理整个框架的数据流,各个组件在其控制下协同工作 SCHEDULER(调度器):负责接收引 ...

  6. Python之Scrapy爬虫框架安装及简单使用

    题记:早已听闻python爬虫框架的大名.近些天学习了下其中的Scrapy爬虫框架,将自己理解的跟大家分享.有表述不当之处,望大神们斧正. 一.初窥Scrapy Scrapy是一个为了爬取网站数据,提 ...

  7. Scrapy爬虫框架(实战篇)【Scrapy框架对接Splash抓取javaScript动态渲染页面】

    (1).前言 动态页面:HTML文档中的部分是由客户端运行JS脚本生成的,即服务器生成部分HTML文档内容,其余的再由客户端生成 静态页面:整个HTML文档是在服务器端生成的,即服务器生成好了,再发送 ...

  8. Python爬虫教程-32-Scrapy 爬虫框架项目 Settings.py 介绍

    本篇介绍项目开发的过程中,对 Setting 文件的配置和使用 Python爬虫教程-32-Scrapy 爬虫框架项目 Settings.py 介绍 settings.py 文件的使用 想要详细查看 ...

  9. Python爬虫教程-31-创建 Scrapy 爬虫框架项目

    本篇是介绍在 Anaconda 环境下,创建 Scrapy 爬虫框架项目的步骤,且介绍比较详细 Python爬虫教程-31-创建 Scrapy 爬虫框架项目 首先说一下,本篇是在 Anaconda 环 ...

随机推荐

  1. Ubuntu 18 开机后直接进入命令行界面,没法进入桌面

    应该是之前不知道干啥,删了gnome的一个东西,导致没法正常进入 暴力解决,直接重装桌面环境 sudo apt install ubuntu-desktop

  2. SpringBoot入门-15(springboot配置freemarker使用YML)

    https://blog.csdn.net/fengsi2009/article/details/78879924 application.yml spring: http: encoding: fo ...

  3. SetViewportOrgEx(视口) 与 SetWindowOrgEx(窗口) 解析

    SetViewportOrgEx (hdc,x/2,y/2) 视口中心点设置到窗口中心 获取客户群x和y,x/2,y/2 ,这样中心点就到窗口中间了. SetWindowOrgEx(hdc,-x/2, ...

  4. _bzoj1007 [HNOI2008]水平可见直线【单调栈】

    传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1007 按斜率排序,去掉斜率相同时,截距较小的直线(即只保留该斜率下截距最大的直线).若当前直 ...

  5. DFS Codeforces Round #299 (Div. 2) B. Tavas and SaDDas

    题目传送门 /* DFS:按照长度来DFS,最后排序 */ #include <cstdio> #include <algorithm> #include <cstrin ...

  6. 32位Oracle10g在64位CentOS下安装失败记录

    环境信息:Alibaba Cloud Elastic Compute Service,CentOS Linux release 7.4.1708 (Core),16C/64GB. 使用32位Oracl ...

  7. LinkedList,SortedList 基本用法

    LinkedList类是双向列表,列表中的每个节点都包含了对前一个和后一个元素的引用. LinkedList<int> ma = new LinkedList<int>(); ...

  8. C# winform与Javascript的相互调用[转]

    原文链接<html> <head> <meta http-equiv="Content-Language" content="zh-cn&q ...

  9. C#_JDBC连接数据库

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  10. 工作记录:JS正则表达式 angularjs ng-if ng-show ng-switch

    用了一下JS 正则表达式判断密码,很简单 学习了angularjs的ng-if ng-show ng-switch的区别并使用 https://www.cnblogs.com/54td/p/59743 ...