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

来源:2-7 spider文件的编写(2)

qq_情书与猫_0

2018-10-06 16:14

  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'


写回答 关注

1回答

  • qq_邹冲_0
    2018-10-06 22:13:29
    # name = scrapy.Field()
    格式是这样子的那里面有提示呀,你的f没有大写所以意思就是说没有这个属性懂了吧


Python最火爬虫框架Scrapy入门与实践

做为爬虫工程师Python Scrapy主流爬虫框架你必须要会!

67418 学习 · 223 问题

查看课程

相似问题