Answer the question
In order to leave comments, you need to log in
Why cUrl does not want to output data when parsing Ajax?
For the sake of interest, I decided to parse sites with ajax, everything went well until I came across one site. I found an ajax request through the Google console and drove it into the cUrl line.
$url = 'https://anapa.etagi.com/msearcher_ajax.php?action=modular_search&subAction=objects&class=nh_flats&city_id=748&language=&count=0&isLoading=true&perPage=15&offset=0¤tPage=0&pageNum=0&type=&rooms=&district_id=&metro_station_id=&street_id=&trakt_id=&typesAnalytics=&wall_id=&series_id=&keep=&class=nh_flats&builder_id=&newcomplex_id=&object_id=&action_sl=&deadline_date=&collections=%5Bobject%20Object%5D&or=rooms&order=price%20asc&layoutType=0&realtyType=nh_flats';
$ch = curl_init($url);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false);
$html = curl_exec($ch);
curl_close($ch);
print_r($html);
print_r($html);
outputs something like: ���]s#ו5����sN~�1�c:���c�\�HI*��R���*��v��[�~d �r�C���0%�$�JEE�$���Kf��`fQI& Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question