1.新建一个scrapy项目bash
scrapy startproject mySpider
2.新建一个爬虫文件scrapy
# 使用crawl 模板建立,适用于整站爬取 scrapy genspider -t crawl qsbk 'qiushibaike.com' # 使用basic模板建立,适用于循环爬取有规律的网址 scrapy genspider -t basic im "imooc.com"
3.启动爬虫ide
# 无日志启动 scrapy crawl jdsc --nolog # 有日志启动 scrapy crawl jdsc --nolog