Scrapy - AttributeError:'Settings'对象没有属性'update_settings'

时间:2015-10-07 05:40:52

标签: python scrapy

我正在尝试从单个python脚本http://doc.scrapy.org/en/0.24/topics/practices.html

运行scrapy

但是我收到以下错误:

Traceback (most recent call last):
  File "single_python_script.py", line 16, in <module>
    crawler = Crawler(settings)
  File "/Library/Python/2.7/site-packages/scrapy/crawler.py", line 32, in __init__
    self.spidercls.update_settings(self.settings)
AttributeError: 'Settings' object has no attribute 'update_settings'

1 个答案:

答案 0 :(得分:0)

从Scrapy 1.0开始,您应该使用CrawlerProcess而不是Crawler从脚本运行Scrapy Spider。

有关更多信息,请参见latest documentation