1. 首页
  2. 数据库
  3. 其它
  4. scrapy quote 源码

scrapy quote 源码

上传者: 2021-04-25 02:52:54上传 ZIP文件 12.23KB 热度 13次
建立新专案 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'
用户评论