gpt4 book ai didi

javascript - 无法使用 Cheerio 获取 iframe

转载 作者:行者123 更新时间:2023-11-30 15:12:17 24 4
gpt4 key购买 nike

您好,我正在尝试从 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。

这是我收到的回复:

response on console

而实际页面是这样的: orignal page

我的回复中只缺少 iframe 部分。

最佳答案

查看源代码:http://www.watchfree.to/watch-366-Forrest-Gump-movie-online-free-putlocker.html

请查看页面源代码。没有 iframe。这是通用内容。因此,当您请求它时,它不会加载到 DOM。

如果你想打开加载嵌入链接,你可能需要抓取这一行:

var locations = ["http:\/\/streamin.to\/embed-k2msgp8yhhd8-580x326.html","http:\/\/streamin.to\/embed-cbp8zxw3yo3f-580x326.html","http:\/\/embed.nowvideo.sx\/embed.php?v=2729070a4365a","http:\/\/thevideo.me\/embed-wm815ejm5uvb-580x326.html","https:\/\/estream.to\/embed-6u49dntawgr0.html","http:\/\/thevideo.me\/embed-n14mh2bjj2nz-580x326.html","http:\/\/vidtodo.com\/embed-bmjw5u1e18js.html","http:\/\/vidtodo.com\/embed-z8614uxy1824.html","https:\/\/openload.co\/embed\/xTLPXjSGz7o\/","https:\/\/openload.co\/embed\/F8gJS5Y1o1o\/"];

关于javascript - 无法使用 Cheerio 获取 iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44940779/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com