컴퓨터잡담

[php]

by 디케 posted Sep 02, 2011
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄



http://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/



PHP Simple HTML DOM Parser

Description, Requirement & Features

  • A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way!
  • Require PHP 5+.
  • Supports invalid HTML.
  • Find tags on an HTML page with selectors just like jQuery.
  • Extract contents from HTML in a single line.

Download & Documents

Quick Start

// Create DOM from URL or file
$html = file_get_html('http://www.google.com/');

// Find all images 
foreach($html->find('img') as $element) 
       echo $element->src . '<br>';

// Find all links 
foreach($html->find('a') as $element) 
       echo $element->href . '<br>';

Feedback


Author: S.C. Chen (me578022@gmail.com)
Original idea is from Jose Solorzano's HTML Parser for PHP 4
Contributions by: Yousuke Kumakura (Attribute Filters)



Looking for the latest version? Download simplehtmldom_1_5.zip (341.0 kB)
Home simplehtmldom
NameModifiedSizeStatus
Parent folder
Totals: 22 Items