parsing - How Get The text on a separate line with JSOUP in Android? -
a part of html in site (http://example.com) is:
//if html code is: <div class="text-co"> <div class="title"> <a href="">00</a> <a href="">11</a> <a href="">22</a> </div> </div> <div class="text-co"> <div class="title"> <a href="">33</a> <a href="">44</a> <a href="">55</a> </div> </div>
and android code is:
string url = "http://example.com"; progressdialog mprogressdialog; @override protected void doinbackground(void... params) { try { document document = jsoup.connect(url).get(); elements description = document.select("div[class=title] a"); desc = description.text(); } catch (ioexception e) { e.printstacktrace(); } return null; }
and want show '00' in first line , '11' in 2th line , on.
example:
00
11
...
try:
elements description = document.select("div[class=title]"); elements atags = description.select("a"); for(element tag : atags) { string value = tag.text(); }
it's work u?
Comments
Post a Comment