如何在scrapy中将目标页面的结果合并到当前页面? [英] How do I merge results from target page to current page in scrapy?

查看:49
本文介绍了如何在scrapy中将目标页面的结果合并到当前页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要在scrapy中如何从一个页面获取链接的例子,然后点击这个链接,从链接页面获取更多信息,并与第一页的一些数据合并.

Need example in scrapy on how to get a link from one page, then follow this link, get more info from the linked page, and merge back with some data from first page.

推荐答案

在第一页部分填充您的项目,并将其放入您的请求的元数据中.当调用下一页的回调时,它可以将部分填充的请求,放入更多的数据,然后返回.

Partially fill your item on the first page, and the put it in your request's meta. When the callback for the next page is called, it can take the partially filled request, put more data into it, and then return it.

这篇关于如何在scrapy中将目标页面的结果合并到当前页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆