我尝试从下面的 div 标签中提取每个 text() ,但在 a 标签之间没有 text() 。
我用这个没有成功:
//div[@class="availability"]/*[not(self::a)]/text()
这是html
<div class="availability">
Available. Delivered from UK <br><a href="test.com">Click for more</a>
</div>
<div class="availability">
Available. Delivered from HK <br><a href="test.com">Click for more</a>
</div>
<div class="availability">
Available. Delivered from USA <br><a href="test.com">Click for more</a>
</div>
<div class="availability">
Available. Delivered from DE <br><a href="test.com">Click for more</a>
</div>
感谢您引导我走向正确的方向!