Python2.7~AttributeError:' module'对象没有属性' Spider'

时间:2017-06-06 14:59:59

标签: python-2.7

这是脚本~error.py:

import scrapy
class SpidyQuotesViewStateSpider(scrapy.Spider):
    name = 'qlk-viewstate'
    start_urls = ['http://somewebsite.com/search.aspx']
    download_delay = 1.5

从终端我将执行以下命令:

sacredmonkey@sacredmonkey83:~/Desktop$ python2.7 error.py

输出:

Traceback (most recent call last):
  File "error.py", line 2, in <module>
    class SpidyQuotesViewStateSpider(scrapy.Spider):
AttributeError: 'module' object has no attribute 'Spider'

以下是我正在运行的scrapy的当前版本:

sacredmonkey@sacredmonkey83:~/Desktop$ scrapy version -v
Scrapy  : 0.22.2
lxml    : 3.3.3.0
libxml2 : 2.9.1
Twisted : 13.2.0
Python  : 2.7.6 (default, Oct 26 2016, 20:30:19) - [GCC 4.8.4]
Platform: Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty

这是我想要遵循的抓取教程:
https://blog.scrapinghub.com/2016/04/20/scrapy-tips-from-the-pros-april-2016-edition/

我发现了关于这个问题的问题,但我无法解决:
AttributeError: 'module' object has no attribute 'Spider'

0 个答案:

没有答案