获取html中img的src属性

来源:互联网 发布:淘宝上有服装批发吗 编辑:程序博客网 时间:2024/06/10 00:53

代码如下:

Pattern p = Pattern.compile("<img[^<>]*?\\ssrc=['\"]?{.*?}['\"]?\\s.*?>");

Mather m = p.matcher(html);

while(m.find()) {

imgPath = m.group(1);

}

0 0