编辑pipelines.py,添加自定义pipelines类: class MySQLPipeline(object): @classmethod def from_crawler(cls, crawler): # 从项…
标签:cls
Scrapy使用Pipeline写入MongoDB
在pipelines.py中写入MongoDBPipeline,代码如下: from scrapy import Item import pymongo class MongoDBPipeline(object): ""…