Scrapy回溯错误(语法无效)

时间:2018-02-18 23:27:01

标签: python scapy

我一直在关注几个教程,并且我不断获得SyntaxError

C:\Users\Luis\mercado>scrapy crawl mercado -t csv
Traceback (most recent call last):
  File "C:\Users\Luis\Anaconda2\Scripts\scrapy-script.py", line 5, in 
<module>
    sys.exit(scrapy.cmdline.execute())
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\cmdline.py", line 
149,
in execute
    cmd.crawler_process = CrawlerProcess(settings)
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\crawler.py", line 
249,
in __init__
    super(CrawlerProcess, self).__init__(settings)
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\crawler.py", line 
137,
in __init__
    self.spider_loader = _get_spider_loader(settings)
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\crawler.py", line 
336,
in _get_spider_loader
    return loader_cls.from_settings(settings.frozencopy())
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\spiderloader.py", 
line 61, in from_settings return cls(settings)
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\spiderloader.py", 
line 25, in __init__
    self._load_all_spiders()
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\spiderloader.py", 
line 47, in _load_all_spiders
   for module in walk_modules(name):
  File "C:\Users\Luis\Anaconda2\lib\site-packages\scrapy\utils\misc.py", 
line 71
, in walk_modules
    submod = import_module(fullpath)
  File "C:\Users\Luis\Anaconda2\lib\importlib\__init__.py", line 37, in 
import_module
    __import__(name)
      File "C:\Users\Luis\mercado\mercado\spiders\spider.py",     line 7
            Class MercadoSpider(CrawlSpider):
SyntaxError: invalid syntax

你可以帮帮我吗?

1 个答案:

答案 0 :(得分:0)

在Python中,class始终以小写字母书写。您的Python中存在语法错误。