#1211·scrapy

通过设置允许覆盖 `DefaultSpider`

作者: rmax创建于 2015年5月6日更新于 2026年9月22日
标签enhancement

In large projects, we used to have a `BaseSpider` class which is the base class for all spiders. This works well except when using the `shell` and `fetch` commands with unknown domains, which causes the `DefaultSpider` class to be used as the spider instance, which may not implement the methods or attributes required by custom extensions or middlewares.