def parse(self, response): for url in url_list: yield scrapy.Request(url,callback=self.parse_next) # 發(fā)送請求 callback回調(diào)函數(shù) def parse_next(self,response): pass
# pipelines.py文件 # import os # os.renames() import scrapy from scrapy.pipelines.images import ImagesPipeline class ScrapyFirstPipeline(ImagesPipeline): #繼承專門處理圖片、視頻的類ImagesPipeline def process_item(self, item, spider): return item
|