检索视图内容。 [英] Retrieve webview content

查看:152
本文介绍了检索视图内容。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检索一个web视图对象的内容。我试图无济于事获得HttpPost或开始工作(可以张贴其他地方)。结果
我只是想的HTML文本(请参阅下面的尝试 - 在load_result东西应该将其转换为一个字符串)。

I need to retrieve the content of a WebView object. I have tried to no avail to get HttpPost or Get to work (can post that elsewhere).
I simply want the html as text (see the attempt below - something in load_result should convert it to a String).

如:

webview = (WebView) findViewById(R.id.webView1);
webview.loadUrl("http://www.dummy.com");

webview.setWebViewClient(new WebViewClient() {
    // implement your own web view client
    public void onPageFinished(WebView view, String url) {
        load_result();
    }
});

void load_result(){
    String result;

    webview = (WebView) findViewById(R.id.webView1);
    result = new String(webview.toString()); 
}

任何帮助将是非常美联社preciated!

Any help would be highly appreciated!

推荐答案

看看这个:的 http://lexandera.com/2009/01/extracting-html-from-a-webview/

这篇关于检索视图内容。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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