How do I get the web page contents from a WebView?
<p>On Android, I have a <code>WebView</code> that is displaying a page.</p>

<p>How do I get the page source without requesting the page again?</p>

<p>It seems <code>WebView</code> should have some kind of <code>getPageSource()</code> method that returns a string, but alas it does not.</p>

<p>If I enable JavaScript, what is the appropriate JavaScript to put in this call to get the contents?</p>

<pre><code>webview.loadUrl("javascript:(function() { " +  
    "document.getElementsByTagName('body')[0].style.color = 'red'; " +  
    "})()");  
</code></pre>
