尝试获取页面标题时,PhantomJS中的DOM异常18

时间:2015-11-26 17:29:18

标签: node.js phantomjs

我有这个错误:

enter image description here

当我尝试执行此代码时:

var phantom = require('phantom');
phantom.create(function(ph) {
    return ph.createPage(function(page) {
        return page.open("file:///C:/Users/amouna/editor.html", function(status) {
            console.log("opened google? ", status);
            return page.evaluate((function() {
                window.addEventListener('load',Loaded,false);
                function Loaded(){
                    // return document.title;
                    return  document.getElementById('GraphImage');
                }
            }), function(result) {
                console.log('Page title is ' + result);
                return ph.exit();
            });
        });
    });
}, {
    dnodeOpts: {weak: false}
});

0 个答案:

没有答案