我是 python 的新手。我在 64 位操作系统上运行 python 2.7.3 32 位版本。 (我尝试了 64 位,但它没有锻炼)。
我按照教程在我的机器上安装了scrapy。我创建了一个项目,demoz。但是当我输入 scrapy crawl demoz
时,它会显示一个错误。当我在 (C:\python27\scripts) 下点击 scrapy 命令时,我遇到了这个东西,它显示:
C:\Python27\Scripts>scrapy
Scrapy 0.14.2 - no active project
Usage:
scrapy <command> [options] [args]
Available commands:
fetch Fetch a URL using the Scrapy downloader
runspider Run a self-contained spider (without creating a project)
settings Get settings values
shell Interactive scraping console
startproject Create new project
version Print Scrapy version
view Open URL in browser, as seen by Scrapy
Use "scrapy <command> -h" to see more info about a command
C:\Python27\Scripts>
我猜他们在安装中缺少一些东西可以请任何人帮忙..提前谢谢..
最佳答案
您应该在 scrapy.cfg
文件所在的 scrapy 项目文件夹中运行 scrapy crawl spider_name
命令。
来自 docs :
Crawling
To put our spider to work, go to the project’s top level directory and run:
scrapy crawl dmoz
关于python - 未知命令 : crawl error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10123104/