Android:WebView:更改提交(GET)请求的 HTML

发布于 2024-10-07 03:27:35 字数 215 浏览 0 评论 0原文

我在 Android 1.6 上的 WebView 中加载了一个网站,我想获取用户点击“提交”时生成的网站的 HTML 代码。如果重要的话,参数通过 GET 提交。
然后我想更改 HTML 代码并将其显示给用户,而不首先显示真正的答案页面。

也许我可以使用 WebViewClient 中的 onFormResubmission() ?但我真的不知道该怎么办。

感谢您的帮助!

I have a website loaded in WebView on Android 1.6 and I want to get the HTML-Code of a Site which was generated when the user hits Submit. The parameter get submitted by GET, if that's important.
Then I want to change the HTML-Code and show it to the user, without showing the real Answer-page first.

Maybe I could use onFormResubmission() from WebViewClient? But I really have no idea how.

Thanks for the help!

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

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

发布评论

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

评论(1

南笙 2024-10-14 03:27:35

对于 WebView 的 API 来说这是不可能的,因为您无法“获取由 WebView 检索到的站点的 HTML 代码”。欢迎您使用 HttpClient 执行自己的 HTTP 操作,并通过 loadData()loadDataWithBaseURL() 将结果提供给 WebView

This is not possible with WebView's API, because you cannot "get the HTML-Code of a Site" that was retrieved by WebView. You are welcome to perform your own HTTP operations using HttpClient and feed the results to WebView via loadData() or loadDataWithBaseURL().

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