日期:2014-05-19 浏览次数:20719 次
<p> <table border="0" cellspacing="1" summary="" cellpadding="1" width="200"> <tbody> <tr> <td><img alt="" width="750" height="410" src="/mall/userfiles/star/product//Image/WWWWWWWWWWWW20_01_20111125153230.jpg" /></td> </tr> <tr> <td><img alt="" width="750" height="294" src="/mall/userfiles/star/product//Image/WWWWWWWWWWWW20_02_20111125153234.jpg" /></td> </tr> <tr> <td><img alt="" width="750" height="482" src="/mall/userfiles/star/product//Image/WWWWWWWWWWWW20_03_20111125153238.jpg" /></td> </tr> <tr> <td><img alt="" width="750" height="266" src="/mall/userfiles/star/product//Image/WWWWWWWWWWWW20_04_20111125153241.jpg" /></td> </tr> </tbody> </table> </p>
Pattern p = Pattern.compile("<img[^>]+src=\"([^\"]*?)\".*?>"); Matcher m = p.matcher("<td><img alt=\"\" width=\"750\" height=\"482\" src=\"/mall/userfiles/star/product//Image/WWWWWWWWWWWW20_03_20111125153238.jpg\" /></td>"); while (m.find()) { System.out.println(m.group(1)); }
------解决方案--------------------
页面js
var refs = new Array();
var imgs = document.getElementsByTagName("img");
for(var i = 0;i < imgs.length;i++)
{
refs[i] = imgs[i].src;
}
------解决方案--------------------
1楼的应该弄错使用场景了,这东西存在Oracle里面,用不了JS。
先读取出来变成 String
然后:
String str = "<tr>"
+ "<td><img alt=\"\" width=\"750\" height=\"410\" src=\"/mall/userfiles/star/product//Image/WWWWWWWWWWWW20_01_20111125153230.jpg\" />\n</td>"
+ "</tr>\n"
+ "<tr>\n"
+ "<td>\n<img alt=\"\" width=\"750\" height=\"294\" src=\"/mall/userfiles/star/product//Image/WWWWWWWWWWWW20_02_20111125153234.jpg\" /></td>"
+ "</tr>"