gpt4 book ai didi

xml - 不包含零的getXpathCount

转载 作者:行者123 更新时间:2023-12-03 17:05:33 25 4
gpt4 key购买 nike

这是我用于Selenium / PHPUnit的代码:

$this->getXpathCount("//img[contains(@src, 'yes_star')]/../div[contains(text(), '0')]


如何重写此代码以计算不包含文本0的元素的xpath?

最佳答案

使用not()函数,例如:

//img[contains(@src, 'yes_star')]/../div[not(contains(text(), '0'))]

关于xml - 不包含零的getXpathCount,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13242907/

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