[英]How do you detect if a remote website uses flash?
I am trying to write a tool that detects if a remote website uses flash using php. 我正在尝试编写一个工具,该工具可检测是否远程网站使用了PHP。 So far I have written a script that detects if embed or objects exist which give an indicator that there is a possibility of it being installed but some sites encrypt their code so renders this function useless.
到目前为止,我已经编写了一个脚本,该脚本可以检测是否存在嵌入或对象,这些脚本指示有可能安装该对象,但是某些站点对其代码进行加密,因此使此功能无效。
include_once('simple_html_dom.php');
$flashTotalCount = 0;
function file_get_contents_curl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$html = file_get_contents_curl($url);
$doc = new DOMDocument();
@$doc->loadHTML($html);
foreach($html->find('embed') as $pageEmbed){
$flashTotalCount++;
}
foreach($html->find('object') as $pageObject){
$flashTotalCount++;
}
if($flashTotalCount == 0){
echo "NO FLASH";
}
else{
echo "FLASH";
}
Would anyone one know of a way to check to see if a website uses flash or if possible get header information that flash is being used etc. 谁能知道一种检查网站是否使用Flash的方法,或者是否有可能获取正在使用Flash的标题信息等。
Any advise would be helpful. 任何建议都会有所帮助。
As far as I understand, flash can be loaded by javascript. 据我了解,可以通过javascript加载flash。 So you should execute the web page.
因此,您应该执行网页。 For this purposes you'll have to use tool like this: http://seleniumhq.org/docs/02_selenium_ide.html#the-waitfor-commands-in-ajax-applications
为此,您将必须使用如下工具: http : //seleniumhq.org/docs/02_selenium_ide.html#the-waitfor-commands-in-ajax-applications
I don't think that it is usable from php. 我不认为它可用于php。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.