scrapy quote 源码
建立新专案 scrapy startproject quote cd quote 创建蜘蛛quote / spiders / quote_spider.py import scrapy class QuoteSpider(scrapy.Spider): name = "quote" def start_requests(self): url = getattr(self, 'url', None) yield scrapy.Request(url=url, callback=self.parse) def parse(self, response): page = response.url.split("/")[-2] filename = f'quotes-{page}.html'
用户评论