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'
文件列表
scrapy-quote-master.zip
(预估有个15文件)
scrapy-quote-master
quote
scrapy.cfg
253B
quotes-.html
5KB
quote
middlewares.py
4KB
pipelines.py
359B
spiders
__pycache__
quote_spider.cpython-38.pyc
884B
暂无评论