【发布时间】:2014-12-21 05:09:40
【问题描述】:
我在 casperjs 中使用了 jquery。 但返回数据为空。
检查过代码,但我不知道..
html代码是……
<table id="bd_lst" class="bd_lst">
<tr class="notice">
<td class="cate">aaaaa</td>
<td class="title"><a href="11111.html">11111</a></td>
</tr>
<tr class="notice">
<td class="cate">bbbb</td>
<td class="title"><a href="22222.html">22222</a></td>
</tr>
......................
<tr>
<td class="cate">cccc</td>
<td class="title"><a href="aaa.html">3333</a></td> <== i want return data "aaa.html"
</tr>
<tr>
<td class="cate">ddddd</td>
<td class="title"><a href="bbbb.html">4444</a></td>
</tr>
</table>
js 代码是....
var start_link = this.evaluate(function(){
return $("#bd_list tr.notice").last().next().find(".title a").attr("href");
});
start_link 为空..
$("table tr.notice").last().next().find(".title a").attr("href") 在 html javascript 中返回 "aaa.html"..
怎么了?
【问题讨论】: