The www/p5-WWW-Mechanize-TreeBuilder port
p5-WWW-Mechanize-TreeBuilder-1.20000p0 – combines WWW::Mechanize and HTML::TreeBuilder (cvsweb github mirror)
Description
This module combines WWW::Mechanize and HTML::TreeBuilder. Why? Because
I've seen too much code like the following:
like($mech->content, qr{some text
}, "Found the right tag");
Which is just all flavours of wrong - its akin to processing XML with
regexps. Instead, do it like the following:
ok($mech->look_down(_tag => 'p', sub { $_[0]->as_trimmed_text eq 'some
text' })
The anon-sub there is a bit icky, but this means that anyone should
happen to add attributes to the tag (such as an id or a class) it
will still work and find the right tag.
WWW: https://metacpan.org/release/WWW-Mechanize-TreeBuilder
Maintainer
The OpenBSD ports mailing-list
Categories
Run dependencies
Test dependencies
Reverse dependencies
Files
- /usr/local/libdata/perl5/site_perl/WWW/Mechanize/TreeBuilder.pm
- /usr/local/man/man3p/WWW::Mechanize::TreeBuilder.3p