json串"context":"<p>2019.11.12 北京门店宿舍检查结果公布</p><p><img src="/ueditor/jsp/upload/image/20191112/1573554453343096382.png" title="1573554453343096382.png" alt="blob.png"/></p>",
json串只贴了关键代码
jar包下载地址链接: https://pan.baidu.com/s/1Pf1cuIBp3rBe69RGGNm9Zw 提取码: i5c8链接:
1.下载jar包,添加依赖
2.
String context = systemMessage.getContext();
Document parse = Jsoup.parse(context);
Element p = parse.getElementsByTag("p").get(0);
String text = p.text();//获取标签中的文字
tv_context.setText(text);//把文字设置到TextView上
Element e_form = parse.getElementsByTag("p").get(1);
Elements img = e_form.getElementsByTag("img");
String src = img.attr("src");//获取标签中的img属性
参考链接:https://zhidao.baidu.com/question/123669556.html
本文介绍了2019年11月12日北京门店宿舍的检查结果,通过使用Jsoup解析HTML内容,提取了检查的文字说明及图片源链接。
815

被折叠的 条评论
为什么被折叠?



