TypeError: 'Item' object has no attribute '__getitem__'

时间:2021-06-30 06:20:34

Error Msg:

Traceback (most recent call last):
File "start.py", line 8, in <module>
Engine(BaiduSpider).start()
File "/home/hpcm/.virtualenvs/py2_spider/local/lib/python2.7/site-packages/myscrapy-0.1-py2.7.egg/myscrapy/core/engine.py", line 71, in start
self.main()
File "/home/hpcm/.virtualenvs/py2_spider/local/lib/python2.7/site-packages/myscrapy-0.1-py2.7.egg/myscrapy/core/engine.py", line 55, in main
print("********************************", result["url"])
TypeError: 'Item' object has no attribute '__getitem__'

问题:

  继承并重写代码后, 没有创建返回值
问题:

  注意spider重写中间件后注意将返回值返回