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