# Define your item pipelines here## Don't forget to add your pipeline to the ITEM_PIPELINES setting# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html# useful for handling different item types with a single interfacefromitemadapterimportItemAdapterfromscrapy.exceptionsimportDropItemclassTitlePipeline:defprocess_item(self,item,spider):# 移除标题中的空格ifitem["title"]:item["title"]=item["title"].strip()returnitemelse:returnDropItem("异常数据")