Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tokuhirom/html-treebuilder-libxml
drop-in-replacement for HTML::TreeBuilder::XPath
https://github.com/tokuhirom/html-treebuilder-libxml
Last synced: 19 days ago
JSON representation
drop-in-replacement for HTML::TreeBuilder::XPath
- Host: GitHub
- URL: https://github.com/tokuhirom/html-treebuilder-libxml
- Owner: tokuhirom
- License: other
- Created: 2009-03-24T13:42:12.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2024-06-23T10:43:23.000Z (5 months ago)
- Last Synced: 2024-10-11T20:56:51.587Z (about 1 month ago)
- Language: Perl
- Homepage:
- Size: 141 KB
- Stars: 16
- Watchers: 9
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# 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_01Rate no_libxml use_libxml
no_libxml 5.45/s -- -94%
use_libxml 94.3/s 1632% --# AUTHOR
Tokuhiro Matsuno
Tatsuhiko Miyagawa
Masahiro Chiba
# THANKS TO
woremacx++
http://d.hatena.ne.jp/woremacx/20080202/1201927162id:dailyflower
# SEE ALSO
[HTML::TreeBuilder](https://metacpan.org/pod/HTML%3A%3ATreeBuilder), [HTML::TreeBuilder::XPath](https://metacpan.org/pod/HTML%3A%3ATreeBuilder%3A%3AXPath)
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.