在某个 table Cheerio 中选择一个跨度

Selecting a span within a certain table Cheerio

我正在解析一个网站,并且有多个 table 看起来像这样。

<table class="first tableWithData">
<tbody>
<tr class="first rowTable">
<td class="infoAvail">
    <span class="linking">Saturday</span>
</td>
</tr>
</tbody>
</table>

table class 名称对于每个 table 都是唯一的。

我想为这个特定的 table 中的每一行拉出链接的跨度 class,但我正在努力选择要使用的 DOM 选择。

var cheerio = require('cheerio');
var request = require('request');

request('http://testWebsite.com', function (error, response, html) {
  if (!error && response.statusCode == 200) {
    var $ = cheerio.load(html);
    $('table.first tableWithData td span.linking').each(function(i, element)
{
      var a = $(this);
      console.log(a.text());
    });
  }
});

你少了一个点:

table.first.tableWithData td span.linking
//         ^