如何单击页面上的元素而不将其加载给Capybara?
是否可以单击元素而不使用使用页面 Capybara和Ruby?
Is it possible to click on the element without loading the page using
capybara and Ruby?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是不可能的。您需要为浏览器加载页面,以了解单击元素时该怎么做。
如果单击的元素只会触发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.