Use Nightmare.js without ES6 syntax and yield
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I built a simple node script using nightmare.js to scrape websites var Nightmare = require('nightmare'); var vo = require('vo'); vo(run)(function(err, result) { if (err) throw err; }); function *run() { var x = Date.now(); var nightmare = Nightmare(); var html = yield nightmare .goto('http://google.com') .evaluate(function() { return document.getElementsByTagName('html')[0].innerHTML; }); console.log("done in " + (Date.now()-x) + "ms"); console.log("result", html); yield nightmare.end(); } I want to run this in an environment using an older