Merhabalar;
CURL ile şu adrese bağlanmaya çalışıyorum ama nedense json verisi yerine normal html sayfa getiriyor sebebi nedir sizce?
CURL problemi
6
●265
- 14-10-2016, 14:37:22Malesef...
Browser'dan girince açılıyor ama bu şekilde farklı bir sayfa geliyor.
By_MiLaT adlı üyeden alıntı: mesajı görüntüle - 14-10-2016, 14:51:30Üyeliği durduruldu@akbalci;
Önce siteye curl login olmalısın yönlendirmeyi görmez diğer türlü curl.
Yada https://www.carrefoursa.com/senalmar...=1476445068405 buradan çekebilirsin. - 14-10-2016, 14:55:16Normalde browser'dan girince login olma vs gibi birşey çıkmıyor ki (: Mutlaka sayfaya girince session yada cookie göre gösteriyor yoksa üye girişi falan gerek yok :/
TakipciSepetim adlı üyeden alıntı: mesajı görüntüle - 14-10-2016, 14:55:52Üyeliği durdurulduPardon sorun refereR kaYnaklıymış. Aşağıdaki kod çalışıyor.akbalci adlı üyeden alıntı: mesajı görüntüle
<?php function baglanamca($site) { $ch = curl_init(); $hc = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.0.11172 Safari/537.36"; curl_setopt($ch, CURLOPT_REFERER, 'https://www.carrefoursa.com/webresources/search/category/1245/store/38/offset/10/limit/10?_=1476439195581'); curl_setopt($ch, CURLOPT_URL, $site); curl_setopt($ch, CURLOPT_USERAGENT, $hc); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cook.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cook.txt'); curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); $site = curl_exec($ch); echo $site; } baglanamca('https://www.carrefoursa.com/webresources/search/category/1245/store/38/offset/10/limit/10?_=1476439195581'); ?> - 14-10-2016, 15:02:05Hiç referer ihtimalini düşünmemiştim :/ eyw hocam çok saol

TakipciSepetim adlı üyeden alıntı: mesajı görüntüle
