Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Perl Modules

    HTML::TreeBuilder 3.23

    Download button

    No screenshots available
    Downloads: 359  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Pete Krawczyk | More programs
    Perl Artistic License / FREE
    December 20th, 2006, 08:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    HTML::TreeBuilder description

    A parser that builds a HTML syntax tree

    HTML::TreeBuilder is a parser that builds a HTML syntax tree.

    SYNOPSIS

    foreach my $file_name (@ARGV) {
    my $tree = HTML::TreeBuilder->new; # empty tree
    $tree->parse_file($file_name);
    print "Hey, here's a dump of the parse tree of $file_name:n";
    $tree->dump; # a method we inherit from HTML::Element
    print "And here it is, bizarrely rerendered as HTML:n",
    $tree->as_HTML, "n";

    # Now that we're done with it, we must destroy it.
    $tree = $tree->delete;
    }

    (This class is part of the HTML::Tree dist.)


    This class is for HTML syntax trees that get built out of HTML source. The way to use it is to:

    1. start a new (empty) HTML::TreeBuilder object,
    2. then use one of the methods from HTML::Parser (presumably with $tree->parse_file($filename) for files, or with $tree->parse($document_content) and $tree->eof if you've got the content in a string) to parse the HTML document into the tree $tree.
    (You can combine steps 1 and 2 with the "new_from_file" or "new_from_content" methods.)
    2b. call $root->elementify() if you want.
    3. do whatever you need to do with the syntax tree, presumably involving traversing it looking for some bit of information in it,
    4. and finally, when you're done with the tree, call $tree->delete() to erase the contents of the tree from memory. This kind of thing usually isn't necessary with most Perl objects, but it's necessary for TreeBuilder objects. See HTML::Element for a more verbose explanation of why this is the case.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    HTML syntax tree | HTML parser | Perl module | module | parser | build



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM