suchen

Heim  >  Fragen und Antworten  >  Hauptteil

Warum sammelt PHP beim Sammeln von WeChat-Artikeln automatisch den Iframe-Tag-Code in js?

微信截图_20170718173201.png

采集出来的代码

<p id='shipin'><iframe id='aaa' height=300 width=100% src="http://v.qq.com/iframe/ player.html?vid=vid.replace(/^[suFEFFxA0]+|[suFEFFxA0]+$/g,"");    

a.removeAttribute('src');     var obj = window.__getVideoWh(a ),    

mydiv = document.createElement('img');    

mydiv.className = "img_loading";    

mydiv.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIm WNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==";    

mydiv.setAttribute ("data-vid",vid);    

mydiv.style.cssText = "width: " + obj.w + "px !important;height: " + obj.h + "px !important;";    

a .style.display = "none";    

insertAfter(mydiv,a);    

a.style.cssText += ";width: " + obj.w + "px !important;height: " + obj.h + "px !important;";    

a.setAttribute("width",obj.w);    

a.setAttribute("height",obj.h);    

a.setAttribute("data-vh",obj .vh);    

a.setAttribute("data-vw",obj.vw);    

a.setAttribute("src",location.protocol+"//v.qq.com/iframe/player.html?&auto =0" frameborder=0allowfullscreen></iframe></p>    

微信的js里面的 iframe 代码 

(function(){    

var iframe = document.getElementsByTagName('iframe');    

for (var i=0,il=iframe.length;i<il;i++ ) {    

var a = iframe[i];    

var src_ = a.getAttribute('src')||a.getAttribute('data-src')||"";    

if(!/http( s)*://v.qq.com/iframe/(preview|player).html?/.test(src_)){    

continue;    

}    

var vid = getQuery("vid",src_) ;    

if(!vid){    

continue;    

}    

vid=vid.replace(/^[suFEFFxA0]+|[suFEFFxA0]+$/g,"");   

var obj = window.__getVideoWh(a),    

mydiv = document.createElement('img');    

mydiv.src="data:image/ gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==";    

mydiv.setAttribute("data-vid",vid);    

mydiv.style.cssText = "width: " + obj.w + "px !important;height: " + obj.h + "px !important;";

a.style.display = "none"; insertAfter(mydiv,a);

a.style.cssText += ";width: " + obj.w + "px !important;height: " + obj.h + "px !important;"; setAttribute("width",obj.w);

a.setAttribute("height",obj.h);

a.setAttribute("data-vh",obj.vh); data-vw",obj.vw);

a.setAttribute("data-src",location.protocol+"//v.qq.com/iframe/player.html?vid="+ vid + "&width=" +obj.vw+"&height="+obj.vh+"&auto=0");

})();

})();

Warum wird diese Zeichenfolge automatisch erfasst? Wenn es sich um ein Video handelt, wird es angezeigt. Bitte erläutern Sie es

牵佑手--不弃.牵佑手--不弃.2718 Tage vor3289

Antworte allen(1)Ich werde antworten

  • PHP中文网

    PHP中文网2017-07-19 10:53:23

    可以使用phpquery来处理采集过来的内容,,,

    Antwort
    1
  • StornierenAntwort