Extract HTML from a WebView
<p>I want to extract only the Table (TagName: tbody) from the following Webpage: <a href="http://info.tam.ch/custom/stpl_klw.php" rel="nofollow">http://info.tam.ch/custom/stpl_klw.php</a></p>

<p>But it doesn't work. Can somebody help me?</p>

<p>(I used this Tutorial: <a href="http://lexandera.com/2009/01/extracting-html-from-a-webview/" rel="nofollow">http://lexandera.com/2009/01/extracting-html-from-a-webview/</a>)</p>

<p>I tried this:</p>

<pre><code>public class Stundenplan extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    final Context myApp = this; 
    class MyJavaScriptInterface  
    {  
        @SuppressWarnings("unused")  
        public void showHTML(String html)  
        {  
            new AlertDialog.Builder(myApp)  
                .setTitle("HTML")  
                .setMessage(html)  
                .setPositiveButton(android.R.string.ok, null)  
            .setCancelable(false)  
            .create()  
            .show();  
        }  
    }  

    final WebView browser = (WebView)findViewById(R.id.webView);  
    browser.getSettings().setJavaScriptEnabled(true);  
    browser.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT");  
    browser.setWebViewClient(new WebViewClient() {  
        @Override  
        public void onPageFinished(WebView view, String url)  
        {  
            browser.loadUrl("javascript:window.HTMLOUT.showHTML('&lt;head&gt;'+document.getElementsByTagName('tbody')[0].innerHTML+'&lt;/head&gt;');");  
        }  
    });  

    browser.loadUrl("http://info.tam.ch/custom/stpl_klw.php"); 
}
</code></pre>
