赛普拉斯 - 如何通过其中的最后一句话获取元素

发布于 2025-02-09 03:05:31 字数 130 浏览 1 评论 0原文

如果这是ID - > div ID =“ Random_is_good”

我想获得此元素,但只是抓住“ _is_good”

我该怎么做?

或者我只有开始和结束 - > “随机_ _good”

If this is the ID -> div id="random_is_good"

I want to get this element but only to catch "_is_good"

how can i do it ?

Or I only have the start and end -> "random_ _good"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

新一帅帅 2025-02-16 03:05:31

符号 * - 与部分文本匹配

cy.get('[div*="_is_good"]')

符号的匹配元素 ^ - 以给定值$ - 匹配元素开头的

cy.get('div[id^="random_"]')

匹配元素以给定值结束

cy.get('div[id$="_good"]')

Symbol * - Match elements that with partial text match

cy.get('[div*="_is_good"]')

Symbol ^ - Match elements that starts with given value

cy.get('div[id^="random_"]')

Symbol $ - Match elements that ends with given value

cy.get('div[id$="_good"]')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文