Scrapy Common Command line tool introduction

Source: Internet
Author: User

View All Commands

Scrapy-h

View Help information

Scapy--help

View version Information

(venv) ql@ql:~$ scrapy versionscrapy 1.1.2 (venv) ql@ql:~$ (venv) ql@ql:~$ scrapy version-vscrapy    : 1.1.2lxml      : 3.6.4.0LIBXML2   : 2.9.4Twisted   : 16.4.0Python:    2.7.12 (Default, Jul  1, 15:12:24)-[GCC 5.4.0 201606 09]pyopenssl:16.1.0 (OpenSSL 1.0.2g-fips  1 Mar) Platform  : linux-4.4.0-36-generic-x86_64- With-ubuntu-16.04-xenial (venv) ql@ql:~$

Create a new project

Scrapy Startproject Spider_name

Build crawler Genspider (Generator spider)

Multiple spiders can exist in a project, but the name must be unique

Scrapy Genspider name domain# such as: #scrapy genspider Sohu sohu.org

See how many crawlers are in the current project

Scrapy List

View opens a Web page using a browser

Scrapy View www.baidu.com

Shell command, enter Scrpay Interactive environment

#进入该url的交互环境scrapy Shell www.dmoz.org/Computers/Programming/Languages/Python/Books/

Then we enter the interactive environment
We mainly use the response command in this, for example, you can use

Response.xpath () #括号里直接加xpath路径

The Runspider command is used to run the created crawler directly and does not run the entire project

Scrapy Runspider crawler Name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.