Skip to content Skip to sidebar Skip to footer

Unable To Use Simple JSOUP Example To Parse Website Table Data

I'm attempting to extract the following data from a table via Android / JSOUP however I'm having a bit of trouble nailing down the process. I think I'm getting close to being able

Solution 1:

Your table doesn't have title. Try this to get some text in TextView with Jsoup:

try {
        Document doc = Jsoup.connect(params[0]).get();
        Element tableElement = doc.select(".datagrid");
        Element th = doc.select("tr").first;
        Element firstTh = th.select("th").first();
        title = firstTh.text();
} 

Solution 2:

I think that this line

Element th = doc.select("tr").first;

instead it should be written as

Element th = doc.select("tr").first(); 

Post a Comment for "Unable To Use Simple JSOUP Example To Parse Website Table Data"