#Windows平台
1.  pip3 install wheel #安装后,便支持通过wheel文件安装软件,wheel文件官网:https://www.lfd.uci.edu/~gohlke/pythonlibs
2.  下载pywin32的wheel文件:执行pip3 install 下载目录\pywin32-17.9.0-cp36-cp36m-win_amd64.whl
3.  下载twisted的wheel文件:http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 执行pip3 install 下载目录\Twisted-17.9.0-cp36-cp36m-win_amd64.whl pip3 install scrapy 
4.  pip3 install scrapy

#Linux平台 1、pip3 install scrapy


1. 创建project
scrapy startproject 项目名称

项目名称
项目名称/
- spiders # 爬虫文件
- chouti.py
- cnblgos.py
....
- items.py # 持久化
- pipelines # 持久化
- middlewares.py # 中间件
- settings.py # 配置文件(爬虫)
scrapy.cfg # 配置文件(部署)

2. 创建爬虫
cd 项目名称

scrapy genspider chouti chouti.com
scrapy genspider cnblgos cnblgos.com

3. 启动爬虫
scrapy crawl chouti
scrapy crawl chouti --nolog
 
posted on 2018-09-04 18:29  快叫洪哥  阅读(162)  评论(0编辑  收藏  举报