【发布时间】:2023-03-03 13:59:02
【问题描述】:
您好,我正在尝试从 wathfree.to 获取 iframe。
这是我为此目的使用的代码:
function getSecondBody(url2)
{
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 = $('.links_left_container');
embedcodetext2 = embedcode.html();
console.log(embedcodetext2);
return embedcodetext2;
});
}
但返回的响应不包含我需要的 iframe。
这是我收到的回复:
我的回复中仅缺少 iframe 部分。
【问题讨论】:
-
你想从这个 html 代码中得到什么?视频链接? iframe 已通过 javascript 附加到 DOM,您可以通过查看页面源 (Ctrl + U for chrome) 看到所有 html,cheerio 可以抓取的内容并转到第 72 行或使用关键字#player_frame 查找,您将看到它是如何工作的.
标签: javascript html node.js iframe cheerio