如何检索的WebView HTML内容(字符串) [英] How to retrieve HTML content from WebView (as a string)

查看:195
本文介绍了如何检索的WebView HTML内容(字符串)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何检索当前在web视图中显示的所有HTML内容?

How do I retrieve all HTML content currently displayed in a WebView?

我发现 WebView.loadData(),但我无法找到相反的等价物(如WebView.getData())

I found WebView.loadData() but I couldn't find the opposite equivalent (e.g. WebView.getData())

请注意我感兴趣的检索数据超过了我无法控制Web页面(即我不能注入Javascript函数到这些网页,这样它会调用的WebView的JavaScript接口)。

Please note that I am interested in retrieving that data for web pages that I have no control over (i.e. I cannot inject a Javascript function into those pages, so that that it would call a Javascript interface in WebView).

推荐答案

不幸的是,没有简单的方法来做到这一点。

Unfortunately there is not easy way to do this.

请参阅<一href="http://stackoverflow.com/questions/2376471/how-do-i-get-the-web-page-contents-from-a-web-view">How我从一个Web视图获取网页内容?

您可以只让一个Htt的prequest到同一页作为您的WebView,并获得响应。

You could just make a HttpRequest to the same page as your WebView and get the response.

这篇关于如何检索的WebView HTML内容(字符串)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆