官网 https://scrapy.org/html
在任意操做系统下,能够使用pip安装Scrapy,例如:shell
$ pip install scrapy
为确认Scrapy已安装成功,首先在Python中测试可否导入Scrapy模块:api
>>> import scrapy >>> scrapy.version_info (1, 8, 0)
Python爬虫、数据分析、网站开发等案例教程视频免费在线观看浏览器
https://space.bilibili.com/523606542
而后,在 shell 中测试可否执行 Scrapy 这条命令:dom
(base) λ scrapy Scrapy 1.8.0 - no active project Usage: scrapy <command> [options] [args] Available commands: bench Run quick benchmark test fetch Fetch a URL using the Scrapy downloader genspider Generate new spider using pre-defined templates runspider Run a self-contained spider (without creating a project) settings Get settings values shell Interactive scraping console startproject Create new project version Print Scrapy version view Open URL in browser, as seen by Scrapy [ more ] More commands available when run from project directory Use "scrapy <command> -h" to see more info about a command
经过了以上两项检测,说明Scrapy安装成功了。如上所示,咱们安装的是当前最新版本1.8.0scrapy
具体Scrapy安装流程参考: http://doc.scrapy.org/en/latest/intro/install.html##intro-install-platform-notes 里面有各个平台的安装方法ide
$ scrapy Scrapy 1.7.3 - no active project Usage: scrapy <command> [options] [args] Available commands: bench Run quick benchmark test ## 测试电脑性能。 fetch Fetch a URL using the Scrapy downloader ## 将源代码下载下来并显示出来 genspider Generate new spider using pre-defined templates ## 建立一个新的 spider 文件 runspider Run a self-contained spider (without creating a project) ## 这个和经过crawl启动爬虫不一样,scrapy runspider 爬虫文件名称 settings Get settings values ## 获取当前的配置信息 shell Interactive scraping console ## 进入 scrapy 的交互模式 startproject Create new project ## 建立爬虫项目。 version Print Scrapy version view Open URL in browser, as seen by Scrapy ## 将网页document内容下载下来,而且在浏览器显示出来 [ more ] More commands available when run from project directory Use "scrapy <command> -h" to see more info about a command