我django-dynamic-scraper
在我的一个 django 项目中使用。我正在做的事情很简单。我正在继承类以在其方法dynamic_scraper.spiders.DjangoSpider
中具有一些自定义功能。parse
以下是我所做的:
from dynamic_scraper.spiders import DjangoSpider
class CustomSpider(DjangoSpider):
def __init__(self, *args, **kwargs):
# some custom stuff here
super(CustomSpider, self).__init__(*args, **kwargs)
def parse(self, response):
# Modify response based on some custom
# set of rules
super(CustomSpider, self).parse(response)
现在这里方法中的super
调用parse
没有被触发。我确保我继承了正确的类并且它确实有一个 parse 方法。
我尝试在DjangoSpider
的 parse 方法中打印调试语句,但在 stdout 中看不到任何内容。
如果我在超级调用之后尝试打印相同的调试语句,我会在标准输出中看到这些语句。
有任何想法吗 ?