url - How to clear html page before showing into a webview in Android? -


i have url of webpage displayed webview in android app. before showing page want clear html code of page tag (such header, footer, ecc..) in order show few information. how can it? tried solve issue working jsoup can't understand how create , pass "new page" webview. can me?

edit

i cleaned html code useless through jsoup libraries. then, mean of these, head , body content , showing "cleared" web page through these lines:

headurl = doc.select("head").outerhtml(); bodyurl = doc.select("body").outerhtml();  webview.loaddata( "<html>"+headurl+bodyurl+"</html>" , "text/html", "charset=utf-8");  webview.setwebviewclient(new displaywebpageactivityclient()); 

the view shows new page not load css files specified in head(that has not been touched). can me why?

you can fetch webpage want display string, parse , remove whatever don't want , load string data in webview.

something like:

string webcontent = fetchpage(url); string cleanedwebcontent = cleanup(webcontent); webview.loaddata(cleanedwebcontent, "text/html", "utf-8"); 

of course, need implement fetchpage , cleanup not android methods


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -