Node.js如何使用phaeromjs的cheerio

时间:2016-12-16 10:35:37

标签: node.js phantomjs casperjs cheerio

我试过了:

    phantom.casperPath = '/Volumes/SSD/admin/Desktop/parser/node_modules/casperjs';
    phantom.injectJs('/Volumes/SSD/admin/Desktop/parser/node_modules/casperjs/bin/bootstrap.js');

    var cheerio = require('cheerio');
    var casper = require('casper').create(); 
    casper.start('http://google.com', function() {

     $ = cheerio.load(document.querySelector("body").innerHTML);
     console.log($('.logo-subtext'));

   });

脚本显示错误:脚本显示错误

0 个答案:

没有答案