我有一个web page我加载了多个脚本。从这个页面我怎样才能使用Cheerio获取JavaScript变量的值?
从上图,我需要位置的价值。 我正在使用此代码,但它只返回第一个完整的脚本:
function getSecondBody()
{
url2 = 'http://www.watchfree.to/watch-366-Forrest-Gump-movie-online-free-putlocker.html';
request(url2, function(err, resp, body)
{
var $ = cheerio.load(body);
var embedcode = $('script');
embedcodetext2 = embedcode;
console.log(embedcodetext2);
return embedcodetext2;
});
}