【发布时间】:2018-06-20 01:35:25
【问题描述】:
我似乎无法为此选择正确的 css 选择器:
<p ng-bind-html="hotelItem.details.allDetails.policyCancellationInstructions" class="ng-binding">
<div>To cancel this reservation <a href="https://www.getaroom.com/reservations?signature=57c685104ad3fe1525f17d0f54f2bde23ec82596&utm_campaign=Affiliate&utm_medium=cpa&utm_source=studentuniverse.com">click here</a>. If you have questions regarding your booking contact Getaroom's customer care team: United States Customers: <a href="tel:+18002603895">800-260-3895</a>; United Kingdom Customers: <a href="tel:+08000124507">0800-012-4507</a></div>
</p>
我试过没有用:
'span[ng-bind-html="hotelItem.details.allDetails.policyCancellationInstructions"] > div'
任何帮助表示赞赏!
【问题讨论】:
-
提供的 HTML 示例适用于
p节点(没有子节点,没有结束标记),而 CSS 选择器适用于span。分享准确的 HTML -
您编写的 css 选择器包含 div ,为此分享 html。虽然我同意@Andersson
-
更新原帖
-
@PeterCook 很清楚你想要一个
css-selector但到底是哪个元素?你想下一步该做什么?提取一些text?哪个文字?