我试图从网页中提取小部分,并加载到web视图 我曾尝试下面的链接给出解决方案的网页的一部分,但它没有工作如何显示上的WebView的Android
Display a part of the webpage on the webview android
#使用getElementsByClass(“darewod”)提取数据;
htmlDocument = Jsoup.connect(htmlPageUrl).get();
element = htmlDocument.getElementsByClass("darewod");
String html = element.toString();
String mime = "text/html";
String encoding = "utf-8";
我曾尝试以下两种方法来加载到网页视图,但似乎不工作,它只是打印HTML的UI
wv1.loadDataWithBaseURL(null, html, "text/html", "utf-8", null);
wv1.loadData(html, "text/html", null);
你能告诉我,如果我在这里缺少什么?
你能要么份额String html的url或内容?问题可能是:'html'不再是一个有效的html文档,并且缺少所有头部定义(CSS等)。 –
Html有这个值