使用 scrapyd 部署 scrapy

1.scrapyd 是什么?

Scrapyd 是一个用于部署和运行 Scrapy 爬虫项目的服务器应用程序。它使得你可以通过 HTTP 命令来部署、管理和执行多个 Scrapy 爬虫,非常适合持续集成和生产环境中的爬虫部署。

2.安装scrapyd 并使用

2.1 安装 scrapyd

bash 复制代码
F:\scrapydTest>pip install scrapyd

2.2 启动scrapyd

bash 复制代码
F:\scrapydTest>scrapyd

2.3修改配置文件,并添加 bat 文件

添加bat 文件:D:\Python\Python310\ 是python安装路径

bash 复制代码
@echo off
"D:\Python\Python310\python.exe" 
"D:\Python\Python310\Scripts\scrapyd-deploy" %*

执行 scrapyd 效果

2.4 安装客户端并运行客服端

bash 复制代码
F:\scrapydTest>pip install scrapyd-client

运行客服端

bash 复制代码
F:\scrapydTest>scrapyd-deploy
Error: no Scrapy project found in this location

2.5 部署项目到 scrapyd ,进入 scrapy 项目,修改配置.cfg

命令:scrapyd-deploy 部署名(配置文件中设置的名称) -p 项目名称



可用浏览器直接访问:

bash 复制代码
http://localhost:6800/listjobs.json?project=itcastScrapy
bash 复制代码
运行 scrapyd 命令:scrapyd
把项目部署到scrapyd: scrapyd-deploy itcast -p itcastScrapy

scrapydWeb

bash 复制代码
安装
pip install scrapydweb
pip install logparser
pip install pywin32 (针对windows)
参考:https://blog.csdn.net/chang995196962/article/details/116196854
bash 复制代码
参考文档:https://blog.csdn.net/weixin_44799217/article/details/122211609

以上是scrapyd 部署scrapy 项目的简单应用,目前正在学习scrapyd 相关知识,大家有相关内容的学习资料可以评论共享哦

相关推荐
万粉变现经纪人3 天前
如何解决 pip install bitsandbytes 报错 仅支持 Linux+glibc(macOS/Windows 失败)问题
linux·运维·windows·python·scrapy·macos·pip
yuanpan4 天前
Python Scrapy 入门教程:从零学会抓取和解析网页数据
java·python·scrapy
淮北4949 天前
ubuntu22.04将mp4转换成gif
python·scrapy·flask·beautifulsoup·pyqt·matplotlib
tIzE TERV11 天前
【爬虫】使用 Scrapy 框架爬取豆瓣电影 Top 250 数据的完整教程
爬虫·scrapy
NiKick12 天前
网页数据抓取:融合BeautifulSoup和Scrapy的高级爬虫技术
爬虫·scrapy·beautifulsoup
ZC跨境爬虫14 天前
Scrapy分布式爬虫(单机模拟多节点):豆瓣Top250项目设置与数据流全解析
分布式·爬虫·python·scrapy
ZC跨境爬虫14 天前
通俗易懂讲解分布式爬虫基础概念(附Scrapy-Redis实操教程)
redis·分布式·爬虫·python·scrapy
ZC跨境爬虫16 天前
Scrapy实战:5sing原创音乐网多页数据爬取(完整可运行,附避坑指南)
爬虫·python·scrapy·html
一点 内容16 天前
Scrapy框架深度解析:高效构建分布式爬虫的实战指南
分布式·爬虫·scrapy
ZC跨境爬虫18 天前
Scrapy多级请求实战:5sing伴奏网爬取踩坑与优化全记录(JSON提取+Xpath解析)
爬虫·scrapy·html·json