1.
from scrapy.utils.project import get_project_settings
attr = get_project_settings().get('attr')
2.
from scarpy.conf import settings
3.
@classmethod
def from_crawler(cls, crawler):
return cls(
attr = crawler.settings.get('attr')
)
1.
from scrapy.utils.project import get_project_settings
attr = get_project_settings().get('attr')
2.
from scarpy.conf import settings
3.
@classmethod
def from_crawler(cls, crawler):
return cls(
attr = crawler.settings.get('attr')
)
本文标题:itempipeline调用setting里的属性
本文链接:https://www.haomeiwen.com/subject/ftxhbftx.html
网友评论