I have issues with future, here is my code
phantom = Meteor.npmRequire('phantom');
var page;
phantom.create(function (ph) {
ph.createPage(function (pg) {
page = pg;
page.set('settings.userAgent', 'Mozilla/5.0xxxxxx');
});
});
var futu=new Future();
//In server side method
page.open(url, function (status) {
page.getContent(function(content) {
var $ = cheerio.load(content);
var mp4Link = $('#xxxxx > a').attr('href');
console.log(mp4Link);
futu.return(mp4Link);
});
});
return futu.wait();
this is throwing future s resolved more than once error
thought of requesting page with HTTP, is that possible with settings user agent or
any alternative way of doing this?