>  Q&A  >  본문

WeChat 기사를 수집할 때 PHP가 js에서 iframe 태그 코드를 자동으로 수집하는 이유는 무엇입니까?

微信截图_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,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAAfFcSJAAAADU EQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==";    

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

mydiv.style.cssText = "너비: " + obj.w + "px !important;height: " + obj.h + "px !important;";    .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" 프레임보더=0 전체화면 허용></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]+$/g,"");    

a.removeAttribute(' src');    

var obj = window.__getVideoWh(a),    

mydiv = document.createElement('img');    

mydiv.className = "img_loading";

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

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

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

a.style.display = "없음"

insertAfter(mydiv,a);

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

a. setAttribute("너비",obj.w);

a.setAttribute("높이",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");

}

})();

})();

이 문자열이 자동으로 수집되는 이유는 무엇입니까? 영상이 없을 때 표시되는 내용인데 위의 코드입니다

.
牵佑手--不弃.牵佑手--不弃.2622일 전3226

모든 응답(1)나는 대답할 것이다

  • PHP中文网

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

    phpquery를 사용하여 수집된 콘텐츠를 처리할 수 있습니다,,,

    회신하다
    1
  • 취소회신하다