0

I am developing an android project.i want to access some portion of a webpage but how can i do so? which parser suits the best for this task and also how to use this parser. i use the following method to access the webpage but now want to parse this page

public void call_a_site()
    {   
            try
        {      
            Uri uri = Uri.parse( "http://www.dsebd.org/" );
            startActivity(new Intent(Intent.ACTION_VIEW,uri));

        }

    catch(Exception e)
    {

    }
}

plz help.. thanks

Taskin
  • 41
  • 2
  • 7
  • http://stackoverflow.com/questions/5173538/android-jsoup-example might answer your question. – Phil Aug 09 '11 at 14:08

2 Answers2

2

Check out the JSoup cookbook.

http://jsoup.org/cookbook/

This has a lot of good information in it and should be able to answer most of your questions.

You are probably looking for something along the lines of this: http://jsoup.org/cookbook/input/parse-body-fragment

Rob
  • 1,162
  • 2
  • 18
  • 43
0

Jsoup library is the best option for Html parse.

Step 1: Download jsoup.x.x.x.jar download link
Step 2: Import in libs folder in IDE
Step 3: Set as library

Sample

        // Connect to the web site
        Document document = Jsoup.connect(url).get();
        // Using Elements to get the Meta data
        Elements description = document
                    .select("meta[name=description]");
        //Locate the content attribute
            desc = description.attr("content");
Milon
  • 2,221
  • 23
  • 27