我试试这个链接
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="{"variant":"MAIN","index":"0"}">
<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 :(得分:1)
试试这个:
Elements anchors = doc.select("li span img");