2017-09-24 120 views
0

從以下素文字得到的圖像我嘗試此鏈接如何通過jsoup

jSoup to check if a span class exists

,但我想通過jsoup從下面的腳本獲取圖像的URL。

<ul class="a-unordered-list a-nostyle a-button-list a-vertical a-spacing-top-micro"> 
<li class="a-spacing-small item"><span class="a-list-item"> 
    <span class="a-declarative" data-action="thumb-action" data-thumb-action="{&quot;variant&quot;:&quot;MAIN&quot;,&quot;index&quot;:&quot;0&quot;}"> 
     <span class="a-button a-button-selected a-button-thumbnail a-button-toggle a-button-focus"><span class="a-button-inner"><input class="a-button-input" type="submit"><span class="a-button-text" aria-hidden="true"> 
      <img alt="" src="https://images-na.ssl-images-amazon.com/images/I/31XcCgGBePL._SS40_.jpg"> 
     </span></span></span> 
    </span> 
</span></li> 
+0

你嘗試 – Ramanlfc

+0

什麼選擇我想img標籤 –

回答

0

試試這個:

Elements anchors = doc.select("li span img");