gpt4 book ai didi

selenium - XPath 使用包含值的文本区域

转载 作者:行者123 更新时间:2023-12-03 23:49:37 28 4
gpt4 key购买 nike

我已经使用 id 进入了 textarea,但数据是来自 Angular http 客户端的异步数据:

<textarea id="fullJson" ng-model="response.payload"></textarea>

有些文本是在页面加载时手写的。假设我们将编写“ <abc>foo</abc> ”。

在我的java代码中,我使用这个:
ExpectedConditions.presenceOfElementLocated(...)

问题很简单:

如何在我的 XPath 中使用添加 XML 字符:
//textarea[@id='fullJson']

我尝试这个但不起作用:
//textarea[@id='fullJson' and contains(@value, '<')]

我尝试这个但不起作用:
//textarea[@id='fullJson' and contains(@value, 'abc')]

最佳答案

试试这个:

//textarea[@id='fullJson' and (@ng-model = "response.payload")]

或者
//*textarea[@id='fullJson' and (@ng-model = "response.payload")]

如果仍有问题,请上传完整的 html 代码!

关于selenium - XPath 使用包含值的文本区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59626082/

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