Jsoup second element instead of first ()

I translated the PHP Simple HTML DOM request:

$article->find('td[id$=tdDescription] div a', 1)->plaintext; 

in jsoup request:

 resultRow.select("td[id$=tdDescription] > div > a").first().text()); 

as you can see, I am getting the second (1) result in PHP, currently in jsoup with .first () I am accessing the first result (0), but I would also like to access the second result (1), as if I did it?

+8
java php jsoup simple-html-dom
source share
2 answers

Use Elements#get() . This allows you to access items by index.

 resultRow.select("td[id$=tdDescription] > div > a").get(1).text()); 
+15
source share

Use the td[id$=tdDescription] > div > a:eq(2) .

0
source share

All Articles