当img放置在内容中时,从RSS解析图像:编码

时间:2015-11-11 16:35:06

标签: android rss jsoup domparser

我试图解析来自RSS的图像

Elements imgEle = docHtml.select("img");

_item.setImage(imgEle.attr("src"));

它在这里工作

工作(img在描述中):

<description>&lt;p&gt;&lt;a href="http://www.androidpolice.com/wp-content/uploads/2015/11/nexus2cee_linkedin-material.png" class=" no-style"&gt;&lt;img class="alignnone size-hero-size wp-image-345522" src="http://www.androidpolice.com/wp-content/uploads/2015/11/nexus2cee_linkedin-material-728x485.png"

但不在这里(img在内容中:编码):

<img class=" size-large wp-image-2207218 aligncenter" src="http://st.ilfattoquotidiano.it/wp-content/uploads/2015/11/14618338_small-630x404.jpg"

=============================================== =======================

编辑:刚刚找到解决方案。我会把它留在这里为谁感兴趣(非常高兴:))

https://github.com/enricocid/iven-feed-reader/commit/e2f8a487d0fd9dff3ca96024ddf9715e2887a916

1 个答案:

答案 0 :(得分:0)

您可以将RSS中的图像/图像URL存储到List中,然后使用Picasso从Web加载图像。 像这样:

Picasso.with(context).load(data.getImage()).into(imageView);
相关问题