赵走x博客
网站访问量:151962
首页
书籍
软件
工具
古诗词
搜索
登录
Python3网络爬虫实战:46、付费讯代理、阿布云代理的使用
Python3网络爬虫实战:45、代理池的维护
Python3网络爬虫实战:44、代理的设置
Python3网络爬虫实战:43、微博宫格验证码的识别
Python3网络爬虫实战:42、点触点选验证码的识别
Python3网络爬虫实战:41、极验滑动验证码的识别
Python3网络爬虫实战:40、图形验证码的识别
Python3网络爬虫实战:38、动态渲染页面抓取:Splash的使用
Python3网络爬虫实战:37、动态渲染页面抓取:Selenium
Python3网络爬虫实战:36、分析Ajax爬取今日头条街拍美图
Python3网络爬虫实战:35、 Ajax数据爬取
Python3网络爬虫实战:34、数据存储:非关系型数据库存储:Redis
Python3网络爬虫实战:33、数据存储:非关系型数据库存储:MongoDB
Python3网络爬虫实战:32、数据存储:关系型数据库存储:MySQL
Python3网络爬虫实战:31、数据存储:文件存储
Python3网络爬虫实战:30、解析库的使用:PyQuery
Python3网络爬虫实战:29、解析库的使用:BeautifulSoup
Python3网络爬虫实战:28、解析库的使用:XPath
Python3网络爬虫实战:27、Requests与正则表达式抓取猫眼电影排行
Python3网络爬虫实战:26、正则表达式
Python3网络爬虫实战:25、requests:高级用法
Python3网络爬虫实战:24、requests:基本使用
Python3网络爬虫实战:23、使用Urllib:分析Robots协议
Python3网络爬虫实战:21、使用Urllib:处理异常
Python3网络爬虫实战:22、使用Urllib:解析链接
Python3网络爬虫实战:20、使用Urllib发送请求
Python3网络爬虫实战:19、代理基本原理
Python3网络爬虫实战:18、Session和Cookies
Python3网络爬虫实战:17、爬虫基本原理
Python3网络爬虫实战:16、Web网页基础
Python3网络爬虫实战:15、爬虫基础:HTTP基本原理
Python3网络爬虫实战:14、部署相关库的安装:Scrapyrt、Gerapy
Python3网络爬虫实战:13、部署相关库的安装:ScrapydClient、ScrapydAPI
Python3网络爬虫实战:12、部署相关库的安装:Docker、Scrapyd
Python3网络爬虫实战:11、爬虫框架的安装:ScrapySplash、ScrapyRedis
Python3网络爬虫实战:10、爬虫框架的安装:PySpider、Scrapy
Python3网络爬虫实战:9、APP爬取相关库的安装:Appium的安装
Python3网络爬虫实战:8、APP爬取相关库的安装:MitmProxy的安装
Python3网络爬虫实战:7、APP爬取相关库的安装:Charles的安装
Python3网络爬虫实战:6、Web库的安装:Flask、Tornado
Python3网络爬虫实战:5、存储库的安装:PyMySQL、PyMongo、RedisPy、RedisDump
Python3网络爬虫实战:4、数据库的安装:MySQL、MongoDB、Redis
Python3网络爬虫实战:3、解析库的安装:LXML、BeautifulSoup、PyQuery、Tesserocr
Python3网络爬虫实战:2、安装:GeckoDriver、PhantomJS、Aiohttp
Python3网络爬虫实战:1、请求库安装:Requests、Selenium、ChromeDriver
Python3网络爬虫实战:14、部署相关库的安装:Scrapyrt、Gerapy
资源编号:75767
Python3网络爬虫实战
爬虫
热度:104
Scrapyrt 为 Scrapy 提供了一个调度的 HTTP 接口,有了它我们不需要再执行 Scrapy 命令而是通过请求一个 HTTP 接口即可调度 Scrapy 任务,Scrapyrt 比 Scrapyd 轻量级,如果不需要分布式多任务的话可以简单使用 Scrapyrt 实现远程 Scrapy 任务的调度。
# Scrapyrt的安装 Scrapyrt 为 Scrapy 提供了一个调度的 HTTP 接口,有了它我们不需要再执行 Scrapy 命令而是通过请求一个 HTTP 接口即可调度 Scrapy 任务,Scrapyrt 比 Scrapyd 轻量级,如果不需要分布式多任务的话可以简单使用 Scrapyrt 实现远程 Scrapy 任务的调度。 ## 1. 相关链接 * GitHub:https://github.com/scrapinghub/scrapyrt * 官方文档:http://scrapyrt.readthedocs.io ## 2. Pip安装 推荐使用 Pip 安装,命令如下: ``` pip3 install scrapyrt ``` 命令执行完毕之后即可完成安装。 接下来在任意一个 Scrapy 项目中运行如下命令即可启动 HTTP 服务: ``` scrapyrt ``` 运行之后会默认在 9080 端口上启动服务,类似的输出结果如下: ``` scrapyrt 2017-07-12 22:31:03+0800 [-] Log opened. 2017-07-12 22:31:03+0800 [-] Site starting on 9080 2017-07-12 22:31:03+0800 [-] Starting factory
``` 如果想更换运行端口可以使用 -p 参数,如: ``` scrapyrt -p 9081 ``` 这样就会在 9081 端口上运行了。 ## 3. Docker安装 另外 Scrapyrt 也支持 Docker,如想要在 9080 端口上运行,且本地 Scrapy 项目的路径为 /home/quotesbot,可以使用如下命令运行: ``` docker run -p 9080:9080 -tid -v /home/user/quotesbot:/scrapyrt/project scrapinghub/scrapyrt ``` 这样同样可以在 9080 端口上监听指定的 Scrapy 项目。 # Gerapy的安装 Gerapy 是一个 Scrapy 分布式管理模块,本节来介绍一下 Gerapy 的安装方式。 ## 1. 相关链接 GitHub:https://github.com/Gerapy ## 2. Pip安装 推荐使用 Pip 安装,命令如下: ``` pip3 install gerapy ``` ## 3. 测试安装 安装完成之后,可以在 Python 命令行下测试。 ``` $ python3 >>> import gerapy ``` 如果没有错误报出,则证明库已经安装好了。