2017-07-06 22 views
1

こんにちは、wathfree.toからiframeを取得しようとしています。ここでCheerioを使用してiframeを取得できません

は、私は、この目的のために使用していますコードです:

function getSecondBody(url2) 
 
{ 
 
    url2 = 'http://www.watchfree.to/watch-366-Forrest-Gump-movie-online-free-putlocker.html'; 
 
    request(url2, function(err, resp, body) 
 
{ 
 
\t var $ = cheerio.load(body); 
 
    
 
\t var embedcode = $('.links_left_container'); 
 
\t embedcodetext2 = embedcode.html(); 
 
\t console.log(embedcodetext2); 
 
\t return embedcodetext2; 
 
}); 
 
}

しかし、応答が返され、私は必要なのiframeが含まれていません。実際のページは次のようになりながら

response on console

:ここ

は、私は受け付けており応答である orignal page

のみiframeの部分は私の応答がありません。

+0

あなたはopenload埋め込みリンクをしたい場合は、おそらく、この行をクロールする必要がありますか?ビデオリンク? iframeはjavascriptによってDOMに追加されています。cheerioがページのソース(Ctrl + Uはchrome)をクロールして72行目に移動するか、キーワード#player_frameで検索することができます作業。 – hoangdv

答えて

2

view-source:http://www.watchfree.to/watch-366-Forrest-Gump-movie-online-free-putlocker.html

は、ページのソースを見てください。 iframeはありません。それは一般的なコンテンツです。したがって、リクエストすると、DOMにロードされません。あなたは、このhtmlコードから取得したいん何

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\/"]; 
+0

この行の場所を指定できますか? –

+0

@NaveedKhan 51。 – hisener

関連する問題