简体   繁体   English

如何获得这个元素的 xPath?

[英]How to get an xPath of this element?

Here is a website Link这是一个网站链接

I need to catch somehow this popup message, but I don't see any element for this in the code.我需要以某种方式捕获此弹出消息,但我在代码中看不到任何元素。 Any suggestions?有什么建议么?搜索元素

The popup message which you are referring is the outcome of Constraint API's element.setCustomValidity() method.您所指的弹出消息Constraint API 的element.setCustomValidity()方法的结果。

Note : HTML5 Constraint validation doesn't remove the need for validation on the server side.注意:HTML5 约束验证不会消除在服务器端进行验证的需要。 Even though far fewer invalid form requests are to be expected, invalid ones can still be sent by non-compliant browsers (for instance, browsers without HTML5 and without JavaScript) or by bad guys trying to trick your web application.尽管预计无效表单请求会少得多,但不兼容的浏览器(例如,没有 HTML5 和 JavaScript 的浏览器)或试图欺骗您的 web 应用程序的坏人仍然可以发送无效表单请求。 Therefore, like with HTML4, you need to also validate input constraints on the server side, in a way that is consistent with what is done on the client side.因此,与 HTML4 一样,您还需要验证服务器端的输入约束,其方式与客户端所做的一致。


Conclusion结论

As the constraint validation is designed to work of checking the form content on the client side those elements won't be available in the DOM Tree .由于约束验证旨在检查客户端的表单内容,因此这些元素在DOM Tree中不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM