Giter Club home page Giter Club logo

html-treebuilder-libxml's Introduction

NAME

HTML::TreeBuilder::LibXML - HTML::TreeBuilder and XPath compatible interface with libxml

SYNOPSIS

use HTML::TreeBuilder::LibXML;

my $tree = HTML::TreeBuilder::LibXML->new;
$tree->parse($html);
$tree->eof;

# $tree and $node compatible to HTML::Element
my @nodes = $tree->findvalue($xpath);
for my $node (@nodes) {
    print $node->tag;
    my %attr = $node->all_external_attr;
}

HTML::TreeBuilder::LibXML->replace_original(); # replace HTML::TreeBuilder::XPath->new

DESCRIPTION

HTML::TreeBuilder::XPath is libxml based compatible interface to HTML::TreeBuilder, which could be slow for a large document.

HTML::TreeBuilder::LibXML is drop-in-replacement for HTML::TreeBuilder::XPath.

This module doesn't implement all of HTML::TreeBuilder and HTML::Element APIs, but enough methods are defined so modules like Web::Scraper work.

BENCHMARK

This is a benchmark result by tools/benchmark.pl

    Web::Scraper: 0.26
    HTML::TreeBuilder::XPath: 0.09
    HTML::TreeBuilder::LibXML: 0.01_01

                 Rate  no_libxml use_libxml
    no_libxml  5.45/s         --       -94%
    use_libxml 94.3/s      1632%         --

AUTHOR

Tokuhiro Matsuno [email protected]

Tatsuhiko Miyagawa [email protected]

Masahiro Chiba

THANKS TO

woremacx++ http://d.hatena.ne.jp/woremacx/20080202/1201927162

id:dailyflower

SEE ALSO

HTML::TreeBuilder, HTML::TreeBuilder::XPath

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.