2024-05-14 02:32:30 发布
网友
我需要找到一种方法让我的Scrapy spider返回一个定制的JSON响应。它通过scrapyd使用schedule.json进行部署。Schedule.json用JobID和Status响应,但我想向该响应添加更多数据。在
schedule.json
JobID
Status
如果有一种方法,我可以创建一个单独的响应,然后提出一个单独的请求,这样也可以。在
非常感谢!在
(取自Learn to Read the Source, Luke)。
这是可行的。在
基于^{}实现您自己的resource,编写一个render_POST()方法。然后,告诉scrapyd使用您的schedule.json资源实现:
resource
render_POST()
scrapyd
[services] schedule.json = project.module.MySchedule
(取自Learn to Read the Source, Luke)。
这是可行的。在
基于^{} 实现您自己的
resource
,编写一个render_POST()
方法。然后,告诉scrapyd
使用您的schedule.json
资源实现:相关问题 更多 >
编程相关推荐