gpt4 book ai didi

php - 如何嵌套xpath查询

转载 作者:行者123 更新时间:2023-12-02 13:37:26 25 4
gpt4 key购买 nike

我正在使用以下嵌套 xpath 查询

$xpath->query('//ul[@id="ref_1000"]/li[not(strong)][//span[@class="refinementLink"]]');

我想要的是

  • 从 ul 中搜索 id 为 ref_1000 的内容,不包括特定的 li 标签,说出第 1 步
  • 从第 1 步开始,使用类finementLink 从范围内搜索

    有人可以帮我做这个嵌套的 xpath 查询吗?

  • 最佳答案

    表达式:

    //ul[@id="ref_1000"]/li[not(strong)]//span[@class="refinementLink"]

    这将选择任何 span有一个 class字符串值为 refinementLink 的属性这是任何 li 的后代没有strong child 是 ul 的 child 与 id字符串值为 ref_1000 的属性.

    关于php - 如何嵌套xpath查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9040703/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com