Пример #1
0
 /**
  * 获取url链接页面里的 url链接
  * @param $request_url
  * @return array
  * @throws Exception
  * @throws \Exception
  */
 public function urlList($request_url)
 {
     $commonCurl = new CommonCurl();
     //        $commonCrawler = new CommonCrawler();
     $commonCrawler = new BudejieCrawler();
     $file = Yii::$app->runtimePath . '/curl/1.txt';
     $commonCurl->baseCurlFile($request_url, $file);
     $htmlString = file_get_contents($file);
     $htmlString = $commonCurl->formatEncodingUtf8($htmlString);
     $res = $commonCrawler->findA($htmlString);
     $commonCrawler->addCrawlerUrls($request_url, $res);
     return $res;
 }