Querylist collection is successful, one failure and one alternation.

can be collected for the first time, and no array subscript is defined for the second error: 0
can be collected for the third time, so problems occur alternately. The
code is as follows, and there is no problem when log comes out.

public function getOneTitle($content_html){
    //
    $content_rules = [
        "title" => array("title", "text")  //
    ];
    $content_ql = $this->ql->html($content_html)->rules($content_rules)->query();
    $query = $content_ql->getData();
    $data = $query->all();
    if(empty($query->all()[0])){
        Log::write("1>>>".$content_html."<<<<<1end");
        $html2 = $content_ql->getHtml();
        Log::write("2>>>".$html2."<<<<<2end");
        var_dump($data);
    }
    $content = $data[0]["title"];

    return $content;
}
Mar.01,2021

is the same content collected for the first and second time? Print out $query- > all (), the second time you should not select the content


this problem, I have also occurred, it is normal to retrieve it with getHtml, but the acquired content will be loaded in ql- > html (), sometimes it can be loaded, sometimes it will not be loaded. Very strange question. If you just look at the program, there seems to be no problem with such a few lines. It should be a problem with the design of querylist. Later, the process will be called as a plug-in, and there will be no more problems.


how did the landlord solve the problem?
I have also encountered this problem now. There is no problem in collecting page 1 of a page, 2, 3. All the pages failed, and it's no problem to start collecting from page 2. The html obtained by
getHtml () is fine, but the data obtained from getData is empty


querylist.php
you can try to modify it to this

    /**
     * URL
     * @param $url
     * @return string
     */
    private function _request($url)
    {
        $result = file_get_contents($url);
        return $result;
    }
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9c493-18c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9c493-18c4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?