0
<html>
<body>
<table>
<tbody>
<tr>
<!-- More things here -->
</tr>
<tr>
<td>
<table></table>
<table>
<tbody>
<tr>
<td></td>
<td>I want this</td>
</tr>
</tbody>
</table>
<table></table>
</td>
</tr>
<tr>
<!-- More things here -->
</tr>
</tbody>
</table>
</body>
</html>
Donc, c'est la structure HTMl à l'aspect bizarre. L'élément que je veux est l'élément que j'ai marqué dans le HTML.Table d'analyse avec Cheerio
Ceci est le code de Jode Js que j'utilise pour analyser le code HTML. Je ne suis pas très familier avec jQuery.
const $ = cheerio.load(body);
$('table').find('tbody tr:nth-child(1)').each(()=> {
$('td').find('table').each(() => {
console.log($(this).text())
})
})