Scrapy安装
安装Scrapy有两种途径:
- 使用pip安装:
pip install Scrapy
- 使用国内豆瓣安装:
pip install -i https://pypi.douban.com/simple/ scrapy
推荐使用第二种方式,安装速度很快。
Scrapy命令
在命令行中输入scrapy,会直接显示常用的命令:
1、scrapy startproject Demo(项目名)
:创建一个新的项目。
2、scrapy genspider name domain
:name是爬虫的名字,domain是所爬取的网站名。
3、scrapy crawl <spider>
:启动爬虫。
4、scrapy list
:查看所有的爬虫。
5、scrapy fetch <url>
:打印响应。
6、scrapy shell [url]
:调试shell。
在后续的系统设计