Lets say I copy a complete HTML table (when each and every tr
and td
has extra attributes)
into a String. How can I take all the contents (what is between the tags) and create an 2D array that is organized like the original table?
For example for this table:
<table border="1">
<tr align= "center">
<td align="char">TD1</td>
<td>td1</td>
<td align="char">TD1</td>
<td>td1</td>
</tr>
<tr>
<td>TD2</td>
<td>tD2</td>
<td class="bold>Td2</td>
<td>td2</td>
</tr>
</table>
I want this array:
PS: I know I can use regex but it would be extremely complicated. I want a tool like JSoup that can do all the work automatically without much code writing
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…