1.安裝scrapyjson
pip install scrapy
2.新建scrapy項目scrapy
scrapy startproject douban
3.新建scrapy_spideride
cd douban/spiders
scrapy genspider douban_spider movie.douban.com
4.運行項目並保持到csv或jsonspa
# 運行程序 scrapy crawl douban_spider # 保存文件到json scrapy crawl douban_spider -o test.json # 保持文件到csv scrapy crawl douban_spider -o test.csv