从QWebView接收表单信息
我目前正在尝试从 QWebView 接收一些信息,但不幸的是失败了。
如何找出用户在表单中更改了哪些字段?可能有一些我不感兴趣的内容,包括隐藏的内容,我只想要有关用户更改了哪些内容的信息。 (一种方法是使用evaluateJavaScript()列出所有表单和输入并稍后检查它们,但这很丑陋并且对解决第二个问题没有帮助)
另外我想了解有关表单本身的信息。名称、方法和行动是什么?
QWebPage 目前仅提供了类型为 NavigationTypeFormSubscribed 的acceptNavigationRequest() 的重写,这对我没有帮助,因为它没有给我任何这些信息。
感谢您的帮助!
I'm currently trying to receive some information from QWebView but unfortunately fail.
How do I find out which fields the user did change in a form? There may be several including hidden ones which I'm not interested in, I only want information about which ones were altered by the user. (One method for this would be to list all forms and inputs with evaluateJavaScript() and check them later, but this is ugly and doesn't help with the second problem)
Also I want to know information about the form itself. What was the name, method and action?
QWebPage currently only provides a override of acceptNavigationRequest() with type NavigationTypeFormSubmitted which doesn't help me as it doesn't give me any of these information.
Thank you for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,在阅读了这里的一些“相关”问题后,我最终发现唯一的方法可能是 JavaScript。
我的解决方案如下。更改网站上的数据后,m_changedInputs 包含有关哪些表单和哪些输入已更改的信息。
Ok, after reading some of the "Related" questions here I eventually found that the only way may be JavaScript.
My solution is below. After changing data on the website, m_changedInputs contains information about which forms and which inputs have been changed.