创建一个项目

在开始使用 scrapy 之前,你必须启动一个要存储代码的项目。输入目录并运行此代码

scrapy startproject helloProject

该代码的第三部分是项目名称。此代码将创建一个 helloProject 目录,其中包含以下内容:

helloProject/
    scrapy.cfg            # deploy configuration file

    helloProject/         # project's Python module, you'll import your code from here
        __init__.py

        items.py          # project items file

        pipelines.py      # project pipelines file

        settings.py       # project settings file

        spiders/          # a directory where you'll later put your spiders
            __init__.py