未知命令:抓取错误 [英] unknown command: crawl error

查看:39
本文介绍了未知命令:抓取错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Python 的新手.我在 64 位操作系统上运行 python 2.7.3 32 位版本.(我尝试了 64 位,但没有锻炼).

I am a newbie to python. I am running python 2.7.3 version 32 bit on 64 bit OS. (I tried 64 bit but it didn't workout).

我按照教程在我的机器上安装了scrapy.我创建了一个项目,demoz.但是当我输入 scrapy crawl demoz 时,它显示一个错误.当我在 (C:\python27\scripts) 下点击scrapy 命令时,我遇到了这个东西:

I followed the tutorial and installed scrapy on my machine. I have created one project, demoz. But when I enter scrapy crawl demoz it shows an error. I came across this thing when i hit scrapy command under (C:\python27\scripts) it shows:

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>

我想他们在安装过程中缺少一些东西,有人可以帮忙吗..提前致谢..

I guess their is something missing in installation can anybody help please .. Thanks in advance..

推荐答案

你应该在scrapy项目文件夹中运行scrapy crawl spider_name命令,其中scrapy.cfg文件居住.

You should run scrapy crawl spider_name command being in a scrapy project folder, where scrapy.cfg file resides.

来自文档:

爬行

为了让我们的蜘蛛工作,进入项目的顶级目录并运行:

To put our spider to work, go to the project’s top level directory and run:

scrapy crawl dmoz

这篇关于未知命令:抓取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆