需要在Pipeline获取到当前运行的爬虫name
spider.py
class Spider(scrapy.Spider):
name = "xxxx"
pipelines.py
class spiderPipeline(object):
def __init__(self):
self.spidername = **?????**这里如何拿到当前爬虫name xxxxx?
需要在Pipeline获取到当前运行的爬虫name
class Spider(scrapy.Spider):
name = "xxxx"
class spiderPipeline(object):
def __init__(self):
self.spidername = **?????**这里如何拿到当前爬虫name xxxxx?
spider.py
pipelines.py
run
scrapy crawl quotes