Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
drop-in-replacement for HTML::TreeBuilder::XPath
Perl Perl6

Checking in changes prior to tagging of version 0.25.

Changelog diff is:

diff --git Changes Changes
index 1aa3c7f..03ce7a3 100644
--- Changes
+++ Changes
@@ -2,6 +2,18 @@ Revision history for Perl extension HTML::TreeBuilder::LibXML

 {{$NEXT}}

+0.25 2015-04-21T23:39:33Z
+
+    commit 5c46775
+    Author: Yanick Champoux <yanick@babyl.dyndns.org>
+    Date:   Thu Jan 15 14:15:04 2015 -0500
+
+        silence warnings
+
+        ... as the arguments can be undefined
+
+        Fixes #10
+
 0.24 2014-09-22T09:31:26Z

     - Removed Web::Scraper from runtime dependencies.
latest commit aa9c177087
@tokuhirom authored
Failed to load latest commit information.
lib/HTML/TreeBuilder Checking in changes prior to tagging of version 0.25.
t
tools added benchmark script
xt
.gitignore .gitignoring /.project and /.includepath (eclipse)
Build.PL Checking in changes prior to tagging of version 0.24.
Changes Checking in changes prior to tagging of version 0.25.
LICENSE
META.json
README.md
cpanfile Web::Scraper is not needed at runtime. Close #9

README.md

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 tokuhirom@gmail.com

Tatsuhiko Miyagawa miyagawa@cpan.org

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.

Something went wrong with that request. Please try again.