项目本来打算继承scrapy.Spider写一个基类爬虫,然后其他爬虫继承这个爬虫,仅修改配置及基本规则。

但是当基类爬虫测试通过后,继承这个爬虫的爬虫,覆写name属性。

提示错误。

以为是覆写的问题,后来发现,这个继承自scrapy.Spider的爬虫基类,只要一被其他类继承。然后就会报错。

暂时没有解决。

错误信息如下:

Temporarily disabling observer LegacyLogObserverWrapper(<bound method PythonLoggingObserver.emit of <twisted.python.log.PythonLoggingObserver object at 0x7f149ed66320>>) due to exception: [Failure instance: Traceback: <class ‘RecursionError’>: maximum recursion depth exceeded while calling a Python object
/home/langirl/envset/p02/lib/python3.5/site-packages/scrapy/commands/crawl.py:57:run
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/internet/defer.py:965:__del__
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/logger/_logger.py:178:failure
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/logger/_logger.py:132:emit
— <exception caught here> —
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/logger/_observer.py:131:__call__
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/logger/_legacy.py:93:__call__
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/python/log.py:595:emit
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/logger/_legacy.py:154:publishToNewObserver
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/logger/_stdlib.py:113:__call__
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/python/failure.py:521:getTracebackObject
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/python/failure.py:113:__init__
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/python/failure.py:113:__init__
/home/langirl/envset/p02/lib/python3.5/site-packages/twisted/python/failure.py:113:__init__

分类: Error

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。