开发者

Scrapy: use a different .cfg file

By default Scrapy uses scrapy.cfg in the projects root. Is there a way to t开发者_如何学Pythonell it to use a different .cfg file?


No this is the default behavior.See this source.


As v01d said there's no way to explicitly tell scrapy to use a scrapy.cfg wherever you want it to be in the directory tree but if you look at the implementation of closest_scrapy_cfg - https://github.com/scrapy/scrapy/blob/master/scrapy/utils/conf.py#L24 - you can move scrapy.cfg up any level to root and it will find it.

So for example, if your default scrapy.cfg is:

/home/whatever/scrapy-projects/abc/scrapy.cfg

you can move it up one or more level.

Not sure where's the advantage though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜