0
我在Windows 7中使用phantom js 2.1.1。我試圖打印所有innerhtml的列表項。Phantomjs 2.1.1 querySelectorAll()無法打印所有節點列表的innerHTML
我的代碼
var nl =pageCv.evaluate(function(){
return document.querySelectorAll("#main_tabs > ul >li");
});
console.log('main tab Lenght :' + nl.length);
for (var i=0; i<nl.length; i++) {
console.log('id of ' + nl[i].innerHTML);
}
流汗此錯誤
main tab Lenght :3
TypeError: null is not an object (evaluating 'nl[i].innerHTML')
如何打印節點列表中的所有的innerHTML? 請幫幫我
問題是什麼? – Vaviloff