2020-02-29 13:14:41
public function actionIndex() {
        echo "<h1> Crawl data tinhte.vn </h1>";
 
        $theCrawURL = 'https://www.gsmarena.com/samsung_galaxy_s20_ultra_5g-reviews-10040p35.php';
        $arrContextOptions=array(
            "ssl"=>array(
                "verify_peer"=>false,
                "verify_peer_name"=>false,
            ),
        );
 
        $this->simpleHTML = new SimpleHTMLDOM;
        $html = $this->simpleHTML->file_get_html($theCrawURL, false, stream_context_create($arrContextOptions), 0);
 
 
        $COMMENT  = array();
        foreach($html->find('.user-thread') as $element) {
            $item['comment']     = $element->find('p.uopin', 0)->plaintext;
//            $item['userRank']     = $element->find('div.userRank', 0)->plaintext;
//            $item['messageText']     = $element->find('.messageText', 0)->plaintext;
//            $item['DateTime']     = $element->find('.DateTime', 0)->plaintext;
            // $item['intro']    = $element->find('div.intro', 0)->plaintext;
            // $item['details'] = $element->find('div.details', 0)->plaintext;
            $articles[] = $item;
        }
        echo "<pre>";
        print_r($articles);
 
    }
Invalid Email or Password