I am trying to load an html file using ul pages. I am using Jsoup. This is my code:
TextView ptext = (TextView) findViewById(R.id.pagetext);
Document doc = null;
try {
doc = (Document) Jsoup.connect(mNewLinkUrl).get();
} catch (IOException e) {
Log.d(TAG, e.toString());
e.printStackTrace();
}
NodeList nl = doc.getElementsByTagName("meta");
Element meta = (Element) nl.item(0);
String title = meta.attr("title");
ptext.append("\n" + mNewLinkUrl);
When I start, I get an error message indicating that attr is not defined for the type element. What have I done wrong? Forgive me if this seems trivial.
source
share