android html download and parse error

Posted by Brahadeesh on Stack Overflow See other posts from Stack Overflow or by Brahadeesh
Published on 2011-01-10T23:40:53Z Indexed on 2011/01/18 3:53 UTC
Read the original article Hit count: 261

Filed under:
|
|

I am trying to download the html file using the ul of the page. 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 running it, I am getting an error saying attr is not defined for the type element. What have I done wrong? Pardon me if this seems trivial.

© Stack Overflow or respective owner

Related posts about android

Related posts about html