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 Shell 下一篇: Scrapy定義專案