0

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).

eg.

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()); 
}

Any help would be highly appreciated!

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
Jan
  • 1
  • 1

1 Answers1

2

Take a look at this: http://lexandera.com/2009/01/extracting-html-from-a-webview/

sparkymat
  • 9,938
  • 3
  • 30
  • 48