我正在尝试提取未嵌套在HTML元素内的文本。这是HTML
<div class="col-sm-12">
<i class='fa fa-map-marker'></i>theCity
<i class='fa fa-link'></i>theEmail
<i class='fa fa-phone'></i>thePhone1
<i class='fa fa-phone'></i>thePhone2
<b>Fax:</b>theFax
<b>Address:</b>theAddress
</div>
我想得到以下结果
如您所见,这里有不同的格式。城市,电子邮件,电话1和电话2具有相似的格式,而传真和地址具有另一种格式。我尝试使用以下语句获取两种类型的数据,但没有用。
这是我尝试的传真和地址的代码
//b/following-sibling::text()[1]
这里是城市,电子邮件和电话数据类型的代码
normalize-space(//div[@class="fa-map-marker"]/following-sibling::text())
我在做什么错?
我在做什么错?