如何单击页面上的元素而不将其加载给Capybara?

发布于 2025-02-05 10:51:16 字数 38 浏览 1 评论 0原文

是否可以单击元素而不使用使用页面 Capybara和Ruby?

Is it possible to click on the element without loading the page using
capybara and Ruby?

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

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

发布评论

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

评论(1

じ违心 2025-02-12 10:51:16

不,这是不可能的。您需要为浏览器加载页面,以了解单击元素时该怎么做。

如果单击的元素只会触发Web请求,并且您知道该Web请求是什么,那么您可以使用任何Ruby Networking库进行该请求,但您可能会遇到有关Referrer,Cookie等的问题。

No that is not possible. You need to load the page for the browser to know what to do when the element is clicked.

If the element being clicked just triggers a web request and you know what that web request is then you could just make that request using any of the ruby networking libraries but then you may run into issues with referrer, cookies, etc.

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