How can I extract “tr” tags which has directly two “td” tags using jsoup.
sample html
<table>
<tr> <!-- I don't want to extract this tr -->
<td>
<table>
<tr><td>extract</td><td>extract</td></tr> <!-- I want extact this tr -->
<tr><td>extract</td><td>extract</td></tr> <!-- I want extact this tr -->
</table>
</td>
</tr>
</table>
I tried to extract using this query. but I had got 3 tr tags.
doc.select("tr:has(td:eq(1))")
have you tried following query
doc.select("tr tr")?this query should select all table rows which you commented.