使用Mule-Datawave要下载HTML中的所有图像

问题描述

我遇到一种情况,我需要使用Datawave下载HTML中所有添加的图像(URL)。

示例:这是我的HTML收到的有效载荷

<div class="Container"> \n\n
<img src="https://test.documentforce.com/servlet/rtaImage?eid=ka0000000id01&amp;feoid=00aF000002MA1&amp;refid=0BR5w000001mnlq" alt="">
<div>...</div>\n\n
<img src="https://test.documentforce.com/servlet/rtaImage?eid=ka0000000id02&amp;feoid=00aF000002GE2&amp;refid=0BR5w000001hh2u" alt="">\n\n
</div>

您能给我一些示例代码吗,这些示例代码会通过HTML并下载所有实际的图片而不是URL的

解决方法

您可以将具有内容类型的readUrl用作application / octet-stream,尽管它将为您提供字节流。您可以做的是提取url的内容,然后读取文件,类似于所描述的here

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...