android - Jsoup selector syntax for div having same class -


<div class="row">    <div id="content">       <div class="textdata">        </div>       <div class="textdata">        </div>    </div> </div> 

i want text second div class=textdata. did parsed div id=content.

here doinbackground

try {                 document document = jsoup.connect(url).get();                 elements myin = null;                 myin = document.select("div.horoscopetext:eq(1)");                 desc = myin.text().tostring();             } catch (ioexception e) {                 e.printstacktrace();             } 

try this

div#textdata:eq(1) 

eq(n) accepts zero-based index of matched elements. btw, shouldn't have multiple elements same id, use class that. check out selector syntax documentation more examples.

edit

for class instead of id, use div.textdata:eq(1)


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -