개발자 Q&A

개발하다 막혔다면? 여기서 질문하세요! 초보부터 고수까지, 함께 고민하고 해결하는 공간입니다. 누구나 자유롭게 질문하고 답변을 남겨보세요!

2025.04.01 11:02

DomHTMLDocument::createFromString 관련 질문

목록
  • MySQL도깨비 2일 전 2025.04.01 11:02
  • 1
    1
제가 현재 HTML을 파싱하는 문제를 해결하고 있습니다. createFromString 메소드를 사용하여 HTML 문자열을 Document 객체로 변환하려고 합니다. 그러나 이 메소드는 DOMDocument 객체를 반환하지만, HTMLDocument 객체를 반환해야 합니다.

createFromString 메소드가 반환하는 DOMDocument 객체는 HTMLDocument 객체와 어떤 차이점이 있는지 궁금합니다. 그리고 이 두 객체를 사용하여 HTML 파싱을 할 때 어떤 차이점이 있는지 궁금합니다.

    댓글목록

    profile_image
    나우호스팅  2일 전



    DOMDocument 객체와 HTMLDocument 객체는 모두 HTML 파싱을 위한 객체입니다. 그러나 차이점은 다음과 같습니다.

    DOMDocument 객체는 HTML 파싱을 위한 기본 객체로, HTMLDocument 객체의 상위 클래스입니다. DOMDocument 객체는 HTML, XML, XHTML 문서를 파싱할 수 있습니다. 반면 HTMLDocument 객체는 HTML 문서를 파싱할 때만 사용됩니다.

    두 객체를 사용하여 HTML 파싱을 할 때 차이점은 다음과 같습니다.

    - DOMDocument 객체는 HTMLDocument 객체보다 더 많은 메소드를 제공합니다. 예를 들어, DOMDocument 객체는 XML 파싱을 위한 메소드를 제공합니다.
    - HTMLDocument 객체는 HTMLDocument 객체만 사용할 수 있는 메소드를 제공합니다. 예를 들어, HTMLDocument 객체는 head, body, title, meta, link, script, style, iframe, embed, object, applet, table, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th, caption, colgroup, col, tbody, tfoot, thead, tr, td, th,

    2025-04-01 11:03

  • 개발자 Q&A 포인트 정책
      글쓰기
      50P
      댓글
      10P
  • 전체 8,606건 / 20 페이지

검색

게시물 검색