16. HTML::Tree
make parse trees out of
HTML source
HTML::TreeBuilder
builds the parse trees
HTML::Element
parse trees are made up of
element class objects
17. create tree object
HTML::TreeBuilder
#!/usr/bin/perl -w
use warnings FATAL => 'all';
use strict;
use HTML::TreeBuilder;
use Term::ANSIColor;
(@ARGV == 1) || exit print "Usage: [HTML file].n";
(-e $ARGV[0]) || exit print "Input file does not exist.n";
my $root = HTML::TreeBuilder->new;
$root->parse_file($ARGV[0]) || die "$!";
include module
19. Perl & LWP
by Sean M. Burke
"Fetching web pages, Parsing HTML,
Writing Spiders, & More"
http://lwp.interglacial.com/index.html
Chapter 9
HTML Processing with Trees
Chapter 10
Modifying HTML with Trees