我正在搜索解析下面的html表解析为json:
<div id="content">
<h1>content-information</h1>
<table class="testinformation">
<thead>
<tr>
<th>hello</th>
<th>test_text</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://example.com">hello1</a></td>
<td><a href="https://example.com/test_text">test_text</a></td>
</tr>
<tr>
<td><a href="https://example.com">hello2</a></td>
<td><a href="https://example.com/test_text2">test_text2</a></td>
</tr>
</tbody>
</table>
</div>
尝试cheerio,cheerio-table解析器,但没有成功......
你可以试试node-html-to-json
它易于使用且记录良好。