Php Botta Sorun

  1. KısayolKısayol reportŞikayet pmÖzel Mesaj
    juniourfalcon
    juniourfalcon's avatar
    Kayıt Tarihi: 22/Mayıs/2012
    Erkek

    daha birkaç güne kadar çalışan botum bu hatayı veriyor..

     

    Warning: DOMDocument::loadHTML(): Empty string supplied as input in D:\web drivers\YandexDisk\Programlama\Projeler\web\Cennetinternet.pe.hu\bot.php on line 39

    sorunlu kod : $this->domTable->loadHTML($this->htmlTable);

    bu hatayı nasıl düzeltebilirim yardımcı olabilirmisniz...

     

    full kod: 

     

     

    <!DOCTYPE HTML>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Untitled Document</title>

    </head>

    <body>

     

    <?php

     

    class Table

    {

    var $htmlTable;

    var $domTable;

    var $items;

    function __construct()

    {

    $rowCount=0;

    $items=array();

    }

    function ReadFile()

    {

    $url= 'https://www.gamesultan.com/Oyun/wolfteam-joygame-turkce';

    $curl = curl_init($url);

    curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);

    $html = curl_exec($curl);

    curl_close($curl);

    $start = strpos($html,"<table ");

    $end = strpos($html,"</table>");

    $this->htmlTable = substr($html,$start,$end-$start);

    echo "<br>";

    echo $html;

    echo "<br>";

    echo $end;

    }

    function ReadDomTable()

    {

    $this->domTable = new DOMDocument;

    $this->domTable->loadHTML($this->htmlTable);

    }

    function ConvertToArray()

    {

    $this->items=array();

    $trs = $this->domTable->getElementsByTagName('tr');

    $trCount=-1;

    foreach ($trs as $tr)

    {

    if($trCount >-1 )

    {

    $tds = $tr->childNodes;

    $tdCount=1;

    foreach($tds as $td)

    {

    if($tdCount<=4)

    {

    if($tdCount<4)

    {

    $value = $td->nodeValue;

    $this->items[$trCount][]=trim($value);

    }

    else

    {

    $value = $td->ownerDocument->saveHTML($td);

    $temp = str_replace("<td>","",$value);

    $value=$temp;

    $temp = str_replace("</td>","",$value);

    $value=$temp;

    $this->items[$trCount][]=trim($value);

    }

    }

    $tdCount++;

    }

    $trCount++;

    }

    else

    {

    $trCount++;

    }

    }

    }

    function ShowAsHTMLTable()

    {

    if(count($this->items))

    {

    echo $row[0];

    ?>

              

     

    </tbody>

    </table>

    <?php

    }

    }

    }

    $table = new Table();

    $table->ReadFile();

    $table->ReadDomTable();

    $table->ConvertToArray();

    $table->ShowAsHtmlTable();

    ?>

     

    </body>

     

    </html>

  2. KısayolKısayol reportŞikayet pmÖzel Mesaj
    pSkpt
    pSkpt's avatar
    Kayıt Tarihi: 10/Aralık/2010
    Erkek

    Büyük ihtimal veri çektiğiniz sayfanın yapısı değişmiştir.

    $this->htmlTable // burası boş geldiği için loadHTML(...) fonksiyonunu çalıştıramıyor.


    İmza...
  3. KısayolKısayol reportŞikayet pmÖzel Mesaj
    juniourfalcon
    juniourfalcon's avatar
    Kayıt Tarihi: 22/Mayıs/2012
    Erkek

    sitenin kaynak koduna baktığımda table var 

Toplam Hit: 610 Toplam Mesaj: 3
php doom