我读了几个其他类似的Stack Overflow线程,对运行蜘蛛的人有类似的问题,但我认为我在Cloud 9 IDE上的设置有点不同或者我错过了什么。这是我的树:
mikeumus@scrapy-phishtank:~/workspace $ tree
.
├── README.md
├── db.sqlite3
├── manage.py
├── scrapetank
│ ├── scrapetank
│ │ ├── __init__.py
│ │ ├── __init__.pyc
│ │ ├── items.py
│ │ ├── pipelines.py
│ │ ├── settings.py
│ │ ├── settings.pyc
│ │ └── spiders
│ │ ├── __init__.py
│ │ ├── __init__.pyc
│ │ ├── wellsfargo_offline.py
│ │ └── wellsfargo_offline.pyc
│ └── scrapy.cfg
└── scrapy_phishtank
├── __init__.py
├── __init__.pyc
├── settings.py
├── settings.pyc
├── urls.py
├── urls.pyc
├── wsgi.py
└── wsgi.pyc
4 directories, 22 files
这是我从scrapy crawl wellsfargo-offline
/scrapytank
时得到的结果
mikeumus@scrapy-phishtank:~/workspace/scrapetank $ scrapy runspider wellsfargo_offline
Usage
=====
scrapy runspider [options] <spider_file>
runspider: error: File not found: wellsfargo_offline
mikeumus@scrapy-phishtank:~/workspace/scrapetank $ scrapy crawl wellsfargo_offline
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 11, in <module>
sys.exit(execute())
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 143, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 89, in _run_print_help
func(*a, **kw)
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 150, in _run_command
cmd.run(args, opts)
File "/usr/local/lib/python2.7/dist-packages/scrapy/commands/crawl.py", line 58, in run
spider = crawler.spiders.create(spname, **opts.spargs)
File "/usr/local/lib/python2.7/dist-packages/scrapy/spidermanager.py", line 44, in create
raise KeyError("Spider not found: %s" % spider_name)
KeyError: 'Spider not found: wellsfargo_offline'
不确定是什么问题。谢谢你的帮助。 :) 这是我的C9 IDE的链接: https://ide.c9.io/mikeumus/scrapy-phishtank