1HTML::Tree(3) User Contributed Perl Documentation HTML::Tree(3)
2
3
4
6 HTML::Tree - overview of HTML::TreeBuilder et al
7
9 3.23
10
12 use HTML::TreeBuilder;
13 my $tree = HTML::TreeBuilder->new();
14 $tree->parse_file($filename);
15
16 # Then do something with the tree, using HTML::Element
17 # methods -- for example:
18
19 $tree->dump
20
21 # Finally:
22
23 $tree->delete;
24
26 HTML-Tree is a suite of Perl modules for making parse trees out of HTML
27 source. It consists of mainly two modules, whose documentation you
28 should refer to: HTML::TreeBuilder and HTML::Element.
29
30 HTML::TreeBuilder is the module that builds the parse trees. (It uses
31 HTML::Parser to do the work of breaking the HTML up into tokens.)
32
33 The tree that TreeBuilder builds for you is made up of objects of the
34 class HTML::Element.
35
36 If you find that you do not properly understand the documentation for
37 HTML::TreeBuilder and HTML::Element, it may be because you are unfamil‐
38 iar with tree-shaped data structures, or with object-oriented modules
39 in general. Sean Burke has written some articles for The Perl Journal
40 ("www.tpj.com") that seek to provide that background. The full text of
41 those articles is contained in this distribution, as:
42
43 HTML::Tree::AboutObjects
44 "User's View of Object-Oriented Modules" from TPJ17.
45
46 HTML::Tree::AboutTrees
47 "Trees" from TPJ18
48
49 HTML::Tree::Scanning
50 "Scanning HTML" from TPJ19
51
52 Readers already familiar with object-oriented modules and tree-shaped
53 data structures should read just the last article. Readers without
54 that background should read the first, then the second, and then the
55 third.
56
58 You can find documentation for this module with the perldoc command.
59
60 perldoc HTML::Tree
61
62 You can also look for information at:
63
64 * AnnoCPAN: Annotated CPAN documentation
65 <http://annocpan.org/dist/HTML-Tree>
66
67 * CPAN Ratings
68 <http://cpanratings.perl.org/d/HTML-Tree>
69
70 * RT: CPAN's request tracker
71 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-Tree>
72
73 * Search CPAN
74 <http://search.cpan.org/dist/HTML-Tree>
75
77 HTML::TreeBuilder, HTML::Element, HTML::Tagset, HTML::Parser,
78 HTML::DOMbo
79
80 The book Perl & LWP by Sean M. Burke published by O'Reilly and Asso‐
81 ciates, 2002. ISBN: 0-596-00178-9
82
83 It has several chapters to do with HTML processing in general, and
84 HTML-Tree specifically. There's more info at:
85
86 http://www.oreilly.com/catalog/perllwp/
87
88 http://www.amazon.com/exec/obidos/ASIN/0596001789
89
91 HTML::Tree is maintained in Subversion hosted at perl.org.
92
93 http://svn.perl.org/modules/HTML-Tree
94
95 The latest development work is always at:
96
97 http://svn.perl.org/modules/HTML-Tree/trunk
98
99 Any patches sent should be diffed against this repository.
100
102 Thanks to Gisle Aas, Sean Burke and Andy Lester for their original
103 work.
104
105 Thanks to Chicago Perl Mongers (http://chicago.pm.org) for their
106 patches submitted to HTML::Tree as part of the Phalanx project
107 (http://qa.perl.org/phalanx).
108
109 Thanks to the following people for additional patches and documenta‐
110 tion: Terrence Brannon, Gordon Lack, Chris Madsen and Ricardo Signes.
111
113 Original HTML-Tree author Gisle Aas. Handed off to Sean M. Burke. and
114 Andy Lester. Currently maintained by Pete Krawczyk "<petek@cpan.org>".
115
117 Copyright 1995-1998 Gisle Aas; 1999-2004 Sean M. Burke; 2005 Andy
118 Lester; 2006 Pete Krawczyk. (Except the articles contained in
119 HTML::Tree::AboutObjects, HTML::Tree::AboutTrees, and HTML::Tree::Scan‐
120 ning, which are all copyright 2000 The Perl Journal.)
121
122 Except for those three TPJ articles, the whole HTML-Tree distribution,
123 of which this file is a part, is free software; you can redistribute it
124 and/or modify it under the same terms as Perl itself.
125
126 Those three TPJ articles may be distributed under the same terms as
127 Perl itself.
128
129 The programs in this library are distributed in the hope that they will
130 be useful, but without any warranty; without even the implied warranty
131 of merchantability or fitness for a particular purpose.
132
133
134
135perl v5.8.8 2006-08-04 HTML::Tree(3)