jsonp解析 html

https://jsoup.org/cookbook/  官网的教程, 很详细!

<dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.8.3</version>
        </dependency>
/**
     *  获取html里 的img标签
     * @param htmlStr
     * @return
     */
    public static List<String> getImgSrc(String htmlStr) {
        List<String> pics = new ArrayList<String>();
        if(StringUtils.isEmpty(htmlStr)){
            return pics;
        }
        Document doc = Jsoup.parse(htmlStr);
        Elements imgs = doc.getElementsByTag("img");
        for (Element img : imgs){
            pics.add(img.attr("src"));
        }
        return pics;
    }
原文地址:https://www.cnblogs.com/lishupeng/p/5913237.html