
- Scrapy 教程
- Scrapy - 主頁
- Scrapy 基本概念
- Scrapy - 概述
- Scrapy - 環境
- Scrapy - 命令列工具
- Scrapy - 爬蟲
- Scrapy - 選擇器
- Scrapy - 條目
- Scrapy - 條目載入器
- Scrapy - 命令列工具
- Scrapy - 條目管道
- Scrapy - 源匯出
- Scrapy - 請求和響應
- Scrapy - 連結提取器
- Scrapy - 設定
- Scrapy - 異常
- Scrapy 即時專案
- Scrapy - 建立專案
- Scrapy - 定義條目
- Scrapy - 第一個爬蟲
- Scrapy - 抓取
- Scrapy - 提取條目
- Scrapy - 使用條目
- Scrapy - 跟蹤連結
- Scrapy - 爬取的資料
- Scrapy 實用資源
- Scrapy - 快速指南
- Scrapy - 實用資源
- Scrapy - 討論
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
廣告