HTML::MyHTML
A wrapper for MyHTML an HTML parser.
Usage
First you need to install MyHTML. Then install this module via:
panda install HTML::MyHTML
zef install HTML::MyHTML
Example
HTML::MyHTML
use HTML::MyHTML;
my $html = "<div><span>HTML</span></div>";
# init
my HTML::MyHTML $parser .= new;
# parse
$parser.parse($html);
# print tree
$parser.tree.print($parser.tree.document):i;
# print span text
$parser.tree.nodes('span')[0].child.text.say;
# dispose
$parser.dispose;
HTML::MyHTML::Raw
use HTML::MyHTML::Raw;
use HTML::MyHTML::Encoding;
my $html = "<div><span>HTML</span></div>".encode;
# basic init
my $myhtml = myhtml_create();
myhtml_init($myhtml, 0, 1, 0);
# first tree init
my $tree = myhtml_tree_create();
myhtml_tree_init($tree, $myhtml);
# parse html
myhtml_parse($tree, Enc<utf-8>, $html, $html.bytes);
# release resources
myhtml_tree_destroy($tree);
myhtml_destroy($myhtml);