如何从mysql中检索url到噩梦.goto funtion

我在MySql数据库中有一些URL。 这些URL我想要一个接一个地传递给nightmare.goto()然后评估网站。

一旦完成,我想另一个URL传递到nightmare.goto()以便我可以评估数据库中的所有URL。 我该怎么做?

例如:

  nightmare .goto('firsturl.com') .wait(2000) 

评估完成..然后再次

 nightmare .goto('secondurl.com') 

诺言迭代呢?

 var Promise = require('bluebird'); //there are a lot of promise libs var sites = ['https://www.google.it/', 'http://stackoverflow.com/', 'https://github.com']; Promise.each(sites, (url)=>{ return nightmare .goto(url) .wait(2000); });