gpt4 book ai didi

selenium - chekboks 的 Xpath 定位器

转载 作者:行者123 更新时间:2023-12-03 00:54:29 27 4
gpt4 key购买 nike

如何以文本“步骤1.设定 self 开发的方向”为起点,选择Xpath定位器到复选框?

enter image description here

为方便起见,您可以从此处复制文本:

pdp-action-item-header__checkbox pdp-action-item-header__checkbox--unchecked

Step 1. Set the direction for self-development

我这样做了:

//div[@class='pdp-action-item-header__checkbox pdp-action-item-header__checkbox--unchecked']/descendant-or-self::div[text()='Step 1. Set the direction for self-development']

但是这是不对的

最佳答案

你尝试过这个xpath吗?

//div[text()(contains(.,'Step 1'))]/parent::/div[@class='pdp-action-item-header__checkbox pdp-action-item-header__checkbox--unchecked']

关于selenium - chekboks 的 Xpath 定位器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55239447/

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