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

# Scrapy settings for JobBole project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
# http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html BOT_NAME = 'JobBole' SPIDER_MODULES = ['JobBole.spiders']
NEWSPIDER_MODULE = 'JobBole.spiders' # Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'JobBole (+http://www.yourdomain.com)' # 是否遵守爬虫协议,默认遵守,改成Fals,不遵守
ROBOTSTXT_OBEY = False # Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32 # Configure a delay for requests for the same website (default: 0)
# See http://scrapy.readthedocs.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 # 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 http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html # SPIDER_MIDDLEWARES = {
# 'JobBole.middlewares.JobboleSpiderMiddleware': 543,
# } # 图片下载配置
import os
IMAGES_URLS_FIELD = 'img_url'
base_dir = os.path.abspath(os.path.dirname(__file__))
IMAGES_STORE = os.path.join(base_dir, 'images') # Enable or disable downloader middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
# DOWNLOADER_MIDDLEWARES = {
# 'JobBole.middlewares.MyCustomDownloaderMiddleware': 543,
# } # Enable or disable extensions
# See http://scrapy.readthedocs.org/en/latest/topics/extensions.html
#EXTENSIONS = {
# 'scrapy.extensions.telnet.TelnetConsole': None,
#} # Configure item pipelines
# See http://scrapy.readthedocs.org/en/latest/topics/item-pipeline.html ITEM_PIPELINES = {
'JobBole.pipelines.JobboleImagerPipeline': 1,
'JobBole.pipelines.SqlSave': 2,
} # 数据库基本配置
SQL_DBA= {
'host': 'localhost',
'db': 'jobole',
'user': 'root',
'password': 'password',
'charset': 'utf-8',
'use_unicode': True
} # Enable and configure the AutoThrottle extension (disabled by default)
# See http://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 http://scrapy.readthedocs.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'

  

爬取知名社区技术文章_setting_5的更多相关文章

  1. 爬取知名社区技术文章_items_2

    item中定义获取的字段和原始数据进行处理并合法化数据 #!/usr/bin/python3 # -*- coding: utf-8 -*- import scrapy import hashlib ...

  2. 爬取知名社区技术文章_pipelines_4

    获取字段的存储处理和获取普通的路径 #!/usr/bin/python3 # -*- coding: utf-8 -*- import pymysql import gevent import pym ...

  3. 爬取知名社区技术文章_article_3

    爬虫主逻辑处理,获取字段,获取主url和子url #!/usr/bin/python3 # -*- coding: utf-8 -*- import scrapy from scrapy.http i ...

  4. 第4章 scrapy爬取知名技术文章网站(2)

    4-8~9 编写spider爬取jobbole的所有文章 # -*- coding: utf-8 -*- import re import scrapy import datetime from sc ...

  5. 爬取博主所有文章并保存到本地(.txt版)--python3.6

    闲话: 一位前辈告诉我大学期间要好好维护自己的博客,在博客园发布很好,但是自己最好也保留一个备份. 正好最近在学习python,刚刚从py2转到py3,还有点不是很习惯,正想着多练习,于是萌生了这个想 ...

  6. 爬虫实战——Scrapy爬取伯乐在线所有文章

    Scrapy简单介绍及爬取伯乐在线所有文章 一.简说安装相关环境及依赖包 1.安装Python(2或3都行,我这里用的是3) 2.虚拟环境搭建: 依赖包:virtualenv,virtualenvwr ...

  7. Node爬取简书首页文章

    Node爬取简书首页文章 博主刚学node,打算写个爬虫练练手,这次的爬虫目标是简书的首页文章 流程分析 使用superagent发送http请求到服务端,获取HTML文本 用cheerio解析获得的 ...

  8. 使用Python爬取微信公众号文章并保存为PDF文件(解决图片不显示的问题)

    前言 第一次写博客,主要内容是爬取微信公众号的文章,将文章以PDF格式保存在本地. 爬取微信公众号文章(使用wechatsogou) 1.安装 pip install wechatsogou --up ...

  9. Python3.6+Scrapy爬取知名技术文章网站

    爬取分析 伯乐在线已经提供了所有文章的接口,还有下一页的接口,所有我们可以直接爬取一页,再翻页爬. 环境搭建 Windows下安装Python: http://www.cnblogs.com/0bug ...

随机推荐

  1. 19 Zabbix 利用Scripts栏目对Hosts远程执行命令

    点击返回:自学Zabbix之路 19 Zabbix 利用Scripts栏目对Hosts远程执行命令 在Monitoring板块中,有Host出现的地方,单击Host按钮后,都可以执行对Host远程执行 ...

  2. IOS10.3上传照片只能拍照不能选择解决办法

    升级IOS10.3正式版以后可能会出现上传文件的控件只能拍照而不能选择现有图片的问题. 正好被我们碰到了,于是找了找解决思路,发现如下解决思路: 原代码为: <input type=" ...

  3. from Require.js to Webpack(why)

    写在前面: 本文主要参考 From Require.js to Webpack - Part 1 (the reasons),原文作者将项目从 require.js 转移到了 webpack 并详细说 ...

  4. Zabbix Agent for Windows部署(五)

    一.环境介绍 二.软件准备 1.Zabbix官方下载地址:https://www.zabbix.com/download进入Zabbix pre-compiled agents项,下载相应版本 2.将 ...

  5. Flask笔记

    # -*- coding: utf-8 -*- from flask import Flask,render_template,request,redirect,session,url_for imp ...

  6. KinectFusion解析

      三维重建是指获取真实物体的三维外观形貌,并建立可复用模型的一种技术.它是当下计算机视觉的一个研究热点,主要有三方面的用途:1)相比于二维图像,可以获取更全面的几何信息:2)在VR/AR中,建立真实 ...

  7. 在实战中使用Sass和Compass

    第三章 无需计算玩转CSS网格布局 3.1 网格布局介绍 3.2 使用网格布局 3.2.1 术语 1 术语名 定义 是否涉及HTML标签 2 列 内容度量的垂直单位 否 3 容器 构成一个网格布局的H ...

  8. C++课程设计类作业3

    #include <bits/stdc++.h> using namespace std; class A { public: A() { a=b=; cout<<" ...

  9. SQL Server 加密案例解析

    一.概述 加密是一种安全措施,有时候甚至是法律要求.作为攻破Windows系统的最后一道防线,通过加密可以保证在没有密钥的情况下获取备份或者物理介质变得毫无意义. 二.概念 加密层次结构 加密层次结构 ...

  10. [国嵌笔记][026][ARM伪指令]

    ARM机器码 1.汇编程序通过汇编器变成机器码,然后才能在ARM处理器上运行 2.ARM机器码是一个32位的数,被分成了多个段,每个段都有各自的含义 3.格式: cond:表示条件(4位) I:表示源 ...