php HtmlDomParser <script> 태그에서 찾기
HTML에서 `<script>` 태그를 쉽게 찾는 방법을 소개합니다. 간단한 코드로 필요한 정보를 추출할 수 있어요. 자세한 내용이 궁금하다면 클릭해 보세요!
GGAMI
$dom = HtmlDomParser::str_get_html($responseBody);
$scripts = $dom->find('script');
foreach ($scripts as $script) {
ray($script->plaintext);
}$dom->find('script');로 script 태그만 찾아서 처리할 수 있다.