您好,我已经在节点红色中创建了一个流程,用于从该地址https://www.vcwatershed.net/fws/reservoir.html解析表(#weather_table),并且无法提取表“ #weather_table”的第3行的所有数据。请参阅下面显示的tr:child信息
<html>
<head>...</head>
<body>
<body">
<a name="top"></a>
<h1>VCWPD Area Reservoir Report</h1>
<table border="1" id="weather_table">
<tbody>
<tr class="header">...</tr>
<tr class="row0">...</tr>
<tr class="row1">
<td>691</td>
<td>Lake Casitas Dam level</td>
<td>11/29/2019 09:29</td>
<td align="Right">567.00</td>
<td align="Right">238,000</td>
<td align="Right">500.34</td>
<td align="Right">98,037</td>
<td align="Right">---</td>
<td align="Right">0</td>
<td align="Right">-66.66</td>
<td align="Right">41.2%</td>
</tr>
<tr class="row0">...</tr>
<tr class="row1">...</tr>
<tr class="row0">...</tr>
<tr class="row1">...</tr>
</tbody>
</table>
</body">
</body>
</html>
我已经使用html节点和cheerio节点,使用了选择器,例如:
#weather_table
还有一些很具体的东西
#weather_table > tbody > tr:nth-child(3) > td:nth-child(1)
当我将选择器用作#weather_table时,msg.payload仅显示#weather_table的标题。
我什至尝试了“ *”符号。这不会带回表信息,但是会返回表明有json文件用作参考的源代码。这与我无法解析表中的行信息有什么关系吗? json文件名为json/reservoir.json
我将“ cheerio节点”用于以下用途:
msg.payload=$('#weather_table > tbody > tr:nth-child(3)').text();
return msg;
以及“ html节点”
#weather_table > tbody > tr:nth-child(3)
msg.payload中不显示任何表内容,即使它只是
#weather_table > tbody
这时我很沮丧
我期望返回表“ #weather_table”的第三行,以在节点红色仪表板上填充表头,但我能获得的只是标题。 在这一点上,我在想这可能需要一些J查询?但是我在那儿不尽如人意,需要一些帮助。 任何帮助将不胜感激