(9)Scrapy创建项目


从网页中刮取数据,首先需要创建Scrapy项目,用于编写存储代码。要创建一个新的目录下,运行下面的命令:

scrapy startproject first_scrapy


上面的代码将创建一个名称为 first_scrapy 的一个目录,它将包含以下结构:

first_scrapy/
scrapy.cfg            # deploy configuration file
first_scrapy/         # 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

 关注右侧公众号,随时随地查看教程
 Scrapy教程目录 

You may also like...