如何通过jsoup从以下scipt获取图像

时间:2017-09-24 13:22:33

标签: android jsoup

我试试这个链接

jSoup to check if a span class exists

但我想通过jsoup从以下脚本获取图片网址。

    <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>

1 个答案:

答案 0 :(得分:1)

试试这个:

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