• 10-04-2020, 15:53:52
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Merhaba Arkadaşlar;

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/ajax/login.ashx?u=kullanici&p1=sifre');
    curl_setopt($ch, CURLOPT_POST, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_COOKIESESSION, true);
    curl_setopt($ch, CURLOPT_COOKIEJAR, '');
    curl_setopt($ch, CURLOPT_COOKIEFILE, '');
    $response = curl_exec($ch);
    curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/map.aspx');
    curl_setopt($ch, CURLOPT_POST, false);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "");
    $sonuc = curl_exec($ch);
    // $sonuc değişkeni çekmek istediğimiz veri
    
    echo $sonuc;
    Olarak Sisteme giriş yapıyorum fakat ;
    <div class="reportingDashboardGridContainer" style="overflow:hidden">
    <div class="reportingDashboardGraphInnerContainerWrapper">
    
    <div class="reportingDashboardGraphInnerContainerDataWrapper reportingDashboardDeviceDetail">
    <div class="reportingDashboardGraphInnerContainerWrapper">
    <div class="reportingDashboardGraphInnerContainerDataWrapper reportingDashboardCloseIcon"></div>
    <div class="reportingDashboardGraphInnerContainerDataWrapper reportingDashboardBoxContainer">
    <div class="cell cell1">
    buradan sadece reportingDashboardGridContainer kısmını çekmek istiyorum. Araştırmalarıma göre (.*?) gibi şeyler var tam kodu ulaştırabilir misiniz ? Yani sadece o div classı nasıl çekerim ?
  • 10-04-2020, 16:22:30
    #2
    <div class="reportingDashboardGridContainer" style="overflow:hidden">
    bu elementin kapanış tagından sonra gelen birkaç satırı daha atar mısınız?
  • 10-04-2020, 16:28:29
    #3
    Abdullahx adlı üyeden alıntı: mesajı görüntüle
    <div class="reportingDashboardGridContainer" style="overflow:hidden">
    bu elementin kapanış tagından sonra gelen birkaç satırı daha atar mısınız?
    <div class="reportingDashboardGridContainer" style="overflow:hidden">
    <div class="reportingDashboardGraphInnerContainerWrapper">
    
    <div class="reportingDashboardGraphInnerContainerDataWrapper reportingDashboardDeviceDetail">
    <div class="reportingDashboardGraphInnerContainerWrapper">
    <div class="reportingDashboardGraphInnerContainerDataWrapper reportingDashboardCloseIcon"></div>
    <div class="reportingDashboardGraphInnerContainerDataWrapper reportingDashboardBoxContainer">
    <div class="cell cell1">
    <div class="reportingDashboardRow" graph="speedGauge" data-highcharts-chart="2"><div class="highcharts-container" id="highcharts-4" style="position: relative; overflow: hidden; width: 332px; height: 149px; text-align: left; line-height: normal; z-index: 0; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); touch-action: none;"><svg version="1.1" style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;" xmlns="http://www.w3.org/2000/svg" width="332" height="149"><desc>Created with Highcharts 3.0.10</desc><defs><clipPath id="highcharts-5"><rect x="0" y="0" width="332" height="149"></rect></clipPath><linearGradient x1="0" y1="0" x2="1" y2="1" id="highcharts-6"><stop offset="0" stop-color="white" stop-opacity="1"></stop><stop offset="1" stop-color="#bad0e5" stop-opacity="1"></stop></linearGradient></defs><g class="highcharts-grid" zIndex="1"></g><g class="highcharts-axis" zIndex="2"><path fill="none" d="M 106.49396478873234 125.95842557609797 L 97.09703858087326 129.37862700935466"
    şeklinde
    </div>
                <div class="cell cell2" graph="violationBar" data-highcharts-chart="4"><div class="highcharts-container" id="highcharts-10" style="position: relative; overflow: hidden; width: 613px; height: 298px; text-align: left; line-height: normal; z-index: 0; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); touch-action: none;"><svg version="1.1" style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;" xmlns="http://www.w3.org/2000/svg" width="613" height="298"><desc>Created with Highcharts 3.0.10</desc><defs><clipPath id="highcharts-11"><rect x="0" y="0" width="593" height="273"></rect></clipPath></defs><g class="highcharts-grid" zIndex="1"></g><g class="highcharts-grid" zIndex="1"></g><g class="highcharts-axis" zIndex="2"><path fill="none" d="M 10 283.5 L 603 283.5" stroke="#C0D0E0" stroke-width="1" zIndex="7" visibility="visible"></path></g><g class="highcharts-axis" zIndex="2"></g><g class="highcharts-series-group"
  • 10-04-2020, 16:34:18
    #4
    $sonuc = preg_replace('/s+/', ' ', $sonuc);
    preg_match('#<div class="reportingDashboardGridContainer" style="overflow:hidden"> (.*?) </div> <div class="cell cell2" graph="violationBar" data-highcharts-chart="4"#',$sonuc,$result);
    print_r($result[1]);
  • 10-04-2020, 17:12:23
    #5
    Abdullahx adlı üyeden alıntı: mesajı görüntüle
    $sonuc = preg_replace('/s+/', ' ', $sonuc);
    preg_match('#<div class="reportingDashboardGridContainer" style="overflow:hidden"> (.*?) </div> <div class="cell cell2" graph="violationBar" data-highcharts-chart="4"#',$sonuc,$result);
    print_r($result[1]);
    Notice: Undefined offset: 1 in C:xampphtdocscurl.php on line 21 hatası aldım.
  • 10-04-2020, 17:19:18
    #6
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/ajax/login.ashx?u=kullanici&p1=sifre');
    curl_setopt($ch, CURLOPT_POST, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_COOKIESESSION, true);
    curl_setopt($ch, CURLOPT_COOKIEJAR, '');
    curl_setopt($ch, CURLOPT_COOKIEFILE, '');
    $response = curl_exec($ch);
    curl_setopt($ch, CURLOPT_URL, 'https://web.arvento.com/map.aspx');
    curl_setopt($ch, CURLOPT_POST, false);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "");
    $sonuc = curl_exec($ch);
    // $sonuc değişkeni çekmek istediğimiz veri
    preg_match_all('@<div class="reportingDashboardGridContainer" style="(.*?)">(.*?)</div>@si', $sonuc, $result);
    echo $result;
  • 10-04-2020, 17:19:25
    #7
    Hocam kodları görmeden tahmini olarak yazmıştım tutmamış demek ki, birkaç yerde boşluk hatası olmuştur.
    Önce direkt print_r($result); olarak deneyin eğer sonuç çıkarsa offset 1 alırsınız. Az çok pattern yazmayı biliyorsanız bu adres üzerinden kontrol edebilirsiniz.