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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -