How do I retrieve all HTML content currently displayed in a WebView?
I found WebView.loadData()
but I couldn\'t find the opposite equivalent (e.g. WebVi
Add this to your code:
private String getUrlSource(String site) throws IOException {
//GNU Public, from ZunoZap Web Browser
URL url = new URL(site);
URLConnection urlc = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(
urlc.getInputStream(), "UTF-8"));
String inputLine;
StringBuilder a = new StringBuilder();
while ((inputLine = in.readLine()) != null)
a.append(inputLine);
in.close();
return a.toString();
}
then lets say you what to get Google's source you would do:
getURLSource("http://google.com");