Press enter to see results or esc to cancel.

Building Android Application HTML Parsing using JSOUP

This is one of my experiences about how to create android application using JSOUP. JSOUP is a java library which can parse any HTML tag from web page.

Why using JSOUP?

The name of my application is indochord, which showing list of recent chord regurarly. But I dont have any data on server. List of chord available on different website, and thoose site not provide an API. So for alternative way, I parse the HTML page from



How I can do it?

First step, go to and looking for recent chord table. Inspect this element using firebug (Mozilla add ons), we know the name of recent chord table and its parameter.


From picture above, we have a part of HTML tag like this

<div class=“box” style=“height:595px”>

<div class=“boxtitlebox”>

<div class=“boxtitle”><h4>13 RECENT CHORDS</h4></div><div class=“clear”></div>


<div class=“listitem”><a href=“”>

<div class=“subtitle”>Chord Tangga</div>

<div class=“title”>Satu Bendera</div>


<div class=“listitem”><a href=“”> <div class=“subtitle”>Chord JKT48</div>

<div class=“title”>First Rabbit (Kelinci Pertama)</div>


<div class=“listitem”><a href=“”>

<div class=“subtitle”>Chord Ada Band</div>

<div class=“title”>Beib</div>


<div class=“listitem”><a href=“”>

<div class=“subtitle”>Chord Setia Band</div>

<div class=“title”>Jangan Ngarep</div>




I want parse each item contain ahref, subtitle and title. So with JSOUP we can do

Document document = Jsoup.connect(“”).timeout(10000).get();

Element d =“”).first();

Elements subtitles = d.getElementsByClass(“subtitle”); //result : Chord Tangga

Elements titles = d.getElementsByClass(“title”);//result : atu Bendera

Element elementlink :“a[href]”)

String alink = elementlink.attr(“href”)//result :

For more detail, we can read JSOUP documentation here.



Leave a Comment

Show Buttons
Hide Buttons