我有一个包含一组列表项的 HTML 字符串。我想从<li></li>
集合中提取图像 url 和对应的 href 值,并将这些值用作以后的变量。
<img src="./season/123434mango.jpg" width="180" height="148"
alt="mango season" class="png">
<a href="/mango/" class="corners"> </a>
集合示例<li></li>
:
<li>
<img src="./season/123434mango.jpg" width="180" height="148"
alt="mango season" class="png">
<a href="/mango/" class="corners"> </a>
<div class="thumbnail_label">ok</div>
<div class="details">
<div class="title">
<a href=
"/mango/"> mango</a>
<span class="season">2</span>
</div>
<ul class="subject">
<li>read</li>
</ul>
<ul class="sub-info">
<li class="location">Europe</li>
<li class="price">2</li>
</ul>
</div>
</li>