사이트 : https://simplehtmldom.sourceforge.io/ 설치없이 간단하게 사용할 수 있는 php 용 크롤링 api include_once '../simplehtmldom/HtmlWeb.php'; use simplehtmldom\HtmlWeb; // Download a page $doc = new HtmlWeb(); $html = $doc->load('https://www.naver.com'); //li 태그 클래스명으로 찾기 $rst=$html->find('li[class=ofra_list_item]') //첫번째 a 태그 찾기 $rst=$html->find('a', 0) //div 태그 클래스명으로 찾기 $rst=$html->find('div[class=ofra_list_tx_headline]', 0) //텍스트 가져오기 $rst->plaintext //href 값 가져오기 $rst->href...
#
simplehtmldom
#
크롤링
원문 링크 : Simple HTML DOM Parser - 크롤링 API