ITEM_PIPELINES ={
# 自定义的图片处理管道'mzitu.pipelines.ImagesPipelinse':300,}# 设置图片默认地址,必须设置
IMAGES_STORE ='/Users/paul/Desktop/images'# 设置图片通道失效时间
IMAGES_EXPIRES =90
DOWNLOAD_DELAY =0.5# 延迟# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT ="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36"
DEFAULT_REQUEST_HEADERS ={
'Cookie':'Hm_lvt_dbc355aef238b6c32b43eacbbf161c3c=1562892240,1563870209; Hm_lpvt_dbc355aef238b6c32b43eacbbf161c3c=1563934170','Referer':'https://www.mzitu.com/mm/','Upgrade-Insecure-Requests':'1'}# Obey robots.txt rules
ROBOTSTXT_OBEY =False
items要保存的内容
classMzituItem(scrapy.Item):# define the fields for your item here like:# name = scrapy.Field()# 标题 也是设置目录
title = scrapy.Field()# 图片地址
imge_url = scrapy.Field()# 请求头要添加的来源网址
Referer = scrapy.Field()# 图片名称
image_Path = scrapy.Field()