【问题标题】:Exclude inner tag html using XPATH使用 XPATH 排除内部标记 html
【发布时间】:2021-12-13 13:05:51
【问题描述】:

我有一个 HTML

......<div class="p_value">Resale
    <a href="https://www.magicbricks.com/propertyservices/legal-services?inc=pdp_verify_buy_web" target="_blank" style="color: #d8232a; display: block;">Get Documents Verified</a>
</div>....

预期输出:Resale

我的错误输出:Resale Get Documents Verified

我的公式:=IMPORTXML(A2,"//*[normalize-space(text()) = 'Transaction type']/following-sibling::div")

如何排除

【问题讨论】:

    标签: xpath google-sheets-formula


    【解决方案1】:

    你可以试试这个。

    //div/text()
    

    //div[@class="p_value"]/text()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-23
      • 1970-01-01
      • 2023-03-14
      相关资源
      最近更新 更多