scrapy-quote

时间:2024-03-29 07:17:23
【文件属性】:

文件名称:scrapy-quote

文件大小:12KB

文件格式:ZIP

更新时间:2024-03-29 07:17:23

Python

建立新专案 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
----quote()
--------scrapy.cfg(253B)
--------quotes-.html(5KB)
--------quote()
----README.md(3KB)

网友评论