sayfa ile ilgili bütün verilerin arrayını çekebiliyoruz

örnek çıktı instagram resmi adresi için

https://jsoneditoronline.org/#left=cloud.0f4c8403e5684fe7b451ca853c3b0b8b

resimleri arrayın içinde bulabilirsiniz


edit:
entry_data > ProfilePage > 0 > graphql > user > edge_felix_video_timeline > edges >
yoluyla resimlere ulaşabilirsin




$base_url = "https://www.instagram.com";
$profile_url = "";

header('Access-Control-Allow-Origin: *');

function get_web_page( $url )
{
$user_agent="Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36";


$options = array(
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POST => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERAGENT => $user_agent,
CURLOPT_HEADER => false,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => "",
CURLOPT_AUTOREFERER => true,
CURLOPT_CONNECTTIMEOUT => 120,
CURLOPT_TIMEOUT => 120,
CURLOPT_MAXREDIRS => 10,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_VERBOSE => true
);

$ch = curl_init( $url );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch );
curl_close( $ch );

$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['content'] = $content;
return $header;
}

function get_profile_arr($url){
$result = get_web_page($url);
$page = $result['content'];
$page = str_replace(array("/static/bundles","/data"),array("https://www.instagram.com/static/bundles","https://www.instagram.com/data"),$page);
$dom = new DOMDocument;
@$dom->loadHTML($page);
$xpath = new DOMXPath($dom);
$arr_string = $xpath->query("/html/body/script[1]")->item(0)->nodeValue;
$arr_string = str_replace(array("window._sharedData = "),array(""),$arr_string);
$arr_string = rtrim($arr_string,";");
$arr_json = json_decode($arr_string,true);
return json_encode($arr_json,JSON_PRETTY_PRINT);
}

if(isset($_GET['n'])){
$profile_url = $base_url."/".$_GET['n'];
$arr = get_profile_arr($profile_url);
echo($arr);
}
else{
echo("!");
}


?>