2014-05-07 18 views
0

我正在通過node.js刮削部分,我想匹配文本的一部分,並得到結果,但我無法弄清楚。從中我想從解析的元素是:如何通過Jquery匹配文本的一部分?

<td title="shell power rate: score for the matched elements" 
style="text-align:right><b>Score-64</b></td> 

的我的node.js代碼:

$('td[title="shell power rate"]').filter(function(){ 
    var data = $(this); 
    score1_SR = data.text(); 
    console.log(score1_SR); 
}) 

所以在的node.js。我正在使用cheerio庫,我希望文本輸出爲Score-64。

回答