处理带有重音符号的单词

发布于 2025-01-04 02:42:56 字数 356 浏览 4 评论 0原文

我试图通过作为链接的显示名称访问字段,如下所示:

MÓVEL

并尝试通过执行以下操作来访问该项目:

t= $browser.link(:text => "MÓVEL").exists?

t.click

这错误是:

无法定位元素,使用 {:text=>"M\303\223VEL", :tag_name=>"a"} (Watir::Exception::UnknownObjectException)

I'm trying to access a field by the display name that is a link, something like this:

<a class="node" href="javascript: MCMenu(7);">MÓVEL</a>

and trying to access the item by doing this:

t= $browser.link(:text => "MÓVEL").exists?

t.click

the error is:

unable to locate element, using {:text=>"M\303\223VEL", :tag_name=>"a"} (Watir::Exception::UnknownObjectException)

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

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

发布评论

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

评论(1

も让我眼熟你 2025-01-11 02:42:56

尝试使用如下正则表达式:

t = $browser.link(:text => /M.VEL/).exists?

Try it with a regex like this:

t = $browser.link(:text => /M.VEL/).exists?
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文