Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在这个 div 类中:
<div class="black"> <a href="/event.aspx?425627">Vitamin</a> <a href="/club-detail.aspx?id=3213" title="Club profile of Watergate">Watergate</a> </div>
我需要一个 Xpath 表达式来仅获取 a href 标记描述文本,在本例中为“维生素”和“水门事件”。
/div[@class='black']/a[0]/text()
将返回维生素和
/div[@class='black']/a[1]/text()
将返回水门事件。
问候
你最好先google一下。