Scrapy 之配置文件 setting.py

1.爬虫是否遵守 robots 协议:默认是遵守的;不遵守把第二行注释删掉即可

# Obey robots.txt rules
# ROBOTSTXT_OBEY = False

2.爬虫是否让浏览器识别我们的 cookie:默认是识别;不想让浏览器识别,是一种反反爬策略,第二行注释删掉即可

# Disable cookies (enabled by default)
# COOKIES_ENABLED = False

3.实体管道 piplines.py ,是处理数据的,比如写入文件,数据库存储等;默认是关闭的,要启动删掉注释即可

# Configure item pipelines
# See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
#ITEM_PIPELINES = {
#   'taobao_kou_hong.pipelines.TaobaoKouHongPipeline': 300,
#}

猜你喜欢

转载自blog.csdn.net/zjkpy_5/article/details/84568116