<?php
$site = "http://www.amerikaninsesi.com";
$data = file_get_contents($site);
function getData($data,$startTag,$finishTag){
$data= explode($startTag,$data);
$data= $data[1];
$data= explode($finishTag,$data);
$data= $data[0];
return $data;
}
$url_div= getData($data,'<div class="media-block has-img size-2">','<div class="thumb thumb16_9">');
$url = getData($url_div,'<a href="','"');
$url = $site.$url;
$title = file_get_contents($url);
$baslik= getData($title,'<meta content="','" property="og:title" />');
$detay = getData($title,'<div class="wsw">','<h3 class="section-head">');
echo 'Başlık : '.$baslik; echo '<br>';
echo 'Haber Detay : '.$detay; echo '<br>';
?>
Yorumlar