【问题标题】:How to return both png and html in scrapy-splash?如何在scrapy-splash中同时返回png和html?
【发布时间】:2020-08-11 05:51:51
【问题描述】:

如果我有一个从 scrapy-splash 请求返回的 html 和 png,我如何使用该 html 来抓取元素,同时还使用 png 来保存 png 图像?

我要编写 response.html 和 response.png 吗?

【问题讨论】:

    标签: scrapy scrapy-splash splash-js-render


    【解决方案1】:

    当结果是 JSON 对象时返回 SplashJsonResponse。在您的情况下,要访问 png 图像,您可以使用 response.data['png']

    【讨论】:

      猜你喜欢
      • 2017-05-27
      • 2019-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多