對於我的生活,我無法弄清楚如何使用jsoup鏈接結尾在「51u1FaI-FHL._SL500_AA300_.jpg」中選擇img src。Jsoup選擇表格數據
我試過多種東西,但都沒有工作。任何幫助?
doc1 = Jsoup.connect("http://rads.stackoverflow.com/amzn/click/B0051HDDO2").timeout(20000).get();
Element table = doc1.select("table[class=productImageGrid]").first()
Iterator<Element> ite = table.select("td[height=300]").iterator();
感謝, 科迪
<table style="text-align: center;" border="0" cellpadding="0" cellspacing="0" width="300">
<tr>
<td id="prodImageCell" height="300" width="300" style="padding-bottom: 10px;"><img onclick="if(0){ async_openImmersiveView(event);} else {openImmersiveView(event);}" class="prod_image_selector" style="cursor:pointer;" onload="if (typeof uet == 'function') { uet('af'); }" **src="http://ecx.images-amazon.com/images/I/51u1FaI-FHL._SL500_AA300_.jpg"** id="prodImage"/><div id="prodImageCellInner" style="position: relative; height:0px; "><!--Comment for IE as it is empty div--></div></td>
<td id="prodVideoClick" style="display:none"></td>
<img id="loadingImage" src=http://g-ecx.images-amazon.com/images/G/01/ui/loadIndicators/loading-large_boxed._V192195297_.gif style="position: absolute; z-index: 200; display:none">
</tr>
<tr>
<td class="tiny" style="padding-bottom: 5px;"> <span id="prodImageCaption" style="color: #666666; font-size: 10px;">Click for larger image and other views</span> </td>
</tr>
</table>