<div class='ym-gbox adds-header'>
<a href='javascript:(void);' >
<a href="http://epaper.thedailystar.net/" target="_blank">
<img src="http://epaper.thedailystar.net/images/edailystar.png" alt="edailystar" style="float: left; width: 100px; margin-top: 15px;">
</a>
<a href="http://www.banglalink.com.bd/celebrating10years" target="_blank" style="display:block;float: right;">
<img width="490" height="60" src="http://bd.thedailystar.net/upload/ads/2015/02/12/BD-News_490x60.gif" alt="banglalink" >
</a>
</a>
</div>
这是html部分。从这里我想提取图像标签的图像源与源地址src =“http://epaper.thedailystar.net/images/edailystar.png”在android中使用jsoup。但我失败了。如果有人给出答案,我会感谢他。从嵌套div中提取图像源和JSOUP中的标记
这里是我的代码
Document document = Jsoup.connect(url).get();
Elements img = document.select("div[class=ym-gbox adds-header]").first().select("a[href=http://epaper.thedailystar.net/] > img[src]");
String imgSrc = img.attr("src");
什么是网址?所以我可以试试.. – 2015-02-24 19:08:45