AttributeError:'module'对象没有属性'update_settings'scrapy 1.0.5

Zee*_*med 2 attributeerror scrapy python-2.7 scrapy-spider

爬虫通过命令行正常工作,给出了以下错误:

2016-03-30 03:47:59 [scrapy] INFO: Scrapy 1.0.5 started (bot: scrapybot)
2016-03-30 03:47:59 [scrapy] INFO: Optional features available: ssl, http11
2016-03-30 03:47:59 [scrapy] INFO: Overridden settings: {'USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'}

Traceback (most recent call last):
  File "/home/ahmeds/scrapProject/crawler/startcrawls.py", line 11, in <module>
    process.crawl(onioncrawl)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 150, in crawl
    crawler = self._create_crawler(crawler_or_spidercls)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 166, in _create_crawler
    return Crawler(spidercls, self.settings)
  File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 32, in __init__
    self.spidercls.update_settings(self.settings)
AttributeError: 'module' object has no attribute 'update_settings'
Run Code Online (Sandbox Code Playgroud)

这是我根据最新文档按脚本运行我的爬虫的代码.我的scrapy版本是1.0.5.

from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from crawler.spiders import onioncrawl

setting = get_project_settings()
process = CrawlerProcess(setting)
process.crawl(onioncrawl)
process.start()
Run Code Online (Sandbox Code Playgroud)

Zee*_*med 10

我使用Spider文件名而不是Spider类名.