无法识别

时间:2021-04-26 16:06:53

标签: selenium selenium-webdriver

下面是我试图识别的元素的 html

<div class="col-x1"> ==$0
    
        "U Derry
                " ==$0
        </div>
    </div>

对于文本“nh”,我可以使用下面的 xpath 来识别它:

//strong[(text(),'bb')]

2 个答案:

答案 0 :(得分:0)

尝试使用 normalize-space,

//div[normalize-space(text()),'User_123 IFO Derry']

答案 1 :(得分:0)

您可以尝试使用以下 x 路径。在类似的情况下,它对我有用。

"//div[contains(.,'User_123 IFO Derry')]"
相关问题