• 14-10-2016, 14:05:48
    #1
    Merhabalar;

    CURL ile şu adrese bağlanmaya çalışıyorum ama nedense json verisi yerine normal html sayfa getiriyor sebebi nedir sizce?
  • 14-10-2016, 14:26:49
    #2
    ?_= işaretinden sonra time ekleyin veya silip bağlanmaya çalışın
  • 14-10-2016, 14:37:22
    #3
    Malesef...
    Browser'dan girince açılıyor ama bu şekilde farklı bir sayfa geliyor.

    By_MiLaT adlı üyeden alıntı: mesajı görüntüle
    ?_= işaretinden sonra time ekleyin veya silip bağlanmaya çalışın
  • 14-10-2016, 14:51:30
    #4
    Ü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:16
    #5
    Normalde 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
    @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:52
    #6
    Üyeliği durduruldu
    akbalci adlı üyeden alıntı: mesajı görüntüle
    Normalde 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 :/
    Pardon sorun refereR kaYnaklıymış. Aşağıdaki kod çalışıyor.

    <?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:05
    #7
    Hiç referer ihtimalini düşünmemiştim :/ eyw hocam çok saol

    TakipciSepetim adlı üyeden alıntı: mesajı görüntüle
    Pardon sorun refereR kaYnaklıymış. Aşağıdaki kod çalışıyor.

    <?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');
    ?>