问答详情
源自:2-7 spider文件的编写(2)

跟着老师敲代码,还是一直报错

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "C:\Users\Administrator\douban\douban\spiders\douban_spider.py", line 3, in <module>

    from douban.items import DoubanItem

  File "C:\Users\Administrator\douban\douban\items.py", line 11, in <module>

    class DoubanItem(scrapy.Item):

  File "C:\Users\Administrator\douban\douban\items.py", line 15, in DoubanItem

    serial_number = scrapy.field()

AttributeError: module 'scrapy' has no attribute 'field'


提问者:qq_情书与猫_0 2018-10-06 16:14

个回答

  • qq_邹冲_0
    2018-10-06 22:13:29

    # name = scrapy.Field()
    格式是这样子的那里面有提示呀,你的f没有大写所以意思就是说没有这个属性懂了吧