2012-03-31 2 views
-5

Je veuxobtenir plein <Doctype> en utilisant boucle

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 

mais je reçois

<!DOCTYPE html> 
<html lang="en" id="facebook" class="no_js"> 

après avoir utilisé une boucle pour obtenir le corps de réponse HTTP en php à partir du code ci-dessous

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL,'http://www.facebook.com/'); 
$file=fopen("/var/www/myapp/welcome.txt","w+"); 
curl_setopt($ch, CURLOPT_FAILONERROR,1); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); 
curl_setopt($ch, CURLOPT_TIMEOUT, 15); 
curl_setopt($ch,CURLOPT_COOKIE,"PHPSESSID=5b1sXXXXo5niv5p0t24ntbh56X;fusion_user=13XXX.cXXX282138afbe9066b8be1cb426841d"); 
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5"); 
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_FILE, $file); 
$retValue = curl_exec($ch); 
fclose($file); 
curl_close($ch); 
+0

vous pouvez récupérer exactement ce qui est là-bas. Qu'est-ce qui vous fait penser que vous pouvez obtenir quelque chose de différent de ce site? – dldnh

Répondre

0

Remplacez http://www.facebook.com/ par l'URL d'une page avec le type de document souhaité.

Facebook utilise le type de document que vous obtenez.

3

Facebook utilise le HTML5 Doctype - Ce qui est juste <!DOCTYPE html> - Vous serez en mesure de voir que dans le code source pour facebook.com

Questions connexes