네이버 실시간 검색어 20개 추출
페이지 정보
작성자 서방님 댓글 0건 조회 341회 작성일 18-08-17 11:59본문
출처 : https://sir.kr/g5_tip/7214
<?
function NaverKeyWord(){
$Curl = curl_init();
curl_setopt($Curl, CURLOPT_URL, "https://datalab.naver.com/keyword/realtimeList.naver?where=main");
curl_setopt($Curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($Curl, CURLOPT_SSL_VERIFYPEER, FALSE);
$Result = curl_exec($Curl);
$RandList = explode("<ul class=\"rank_list\">", $Result);
$RandList = explode("</ul>", $RandList[1]);
$Rand[0] = explode("<span class=\"title\">", $RandList[0]);
for($i=1; $i < count($Rand[0]); $i++){
$Rand[1] = explode("</span>", $Rand[0][$i]);
$ReturnData = trim(strip_tags($Rand[1][0]));
if($ReturnData){
$Return[] = $ReturnData;
}
}
return $Return;
}
$NaverKeyWord = NaverKeyWord();
print_r($NaverKeyWord);
?>
댓글목록
등록된 댓글이 없습니다.