combines WWW::Mechanize and HTML::TreeBuilder
Project homepage: https://metacpan.org/release/WWW-Mechanize-TreeBuilder
Description
This module combines WWW::Mechanize and HTML::TreeBuilder. Why? Because
I've seen too much code like the following:
like($mech->content, qr{<p>some text</p>}, "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 <p> tag (such as an id or a class) it
will still work and find the right tag.
Package information
- Ports path
- www/p5-WWW-Mechanize-TreeBuilder
- Package architecture
- *
- Maintainer
- The OpenBSD ports mailing-list <ports@openbsd.org>
- Categories
- www, perl5
- Available flavors
- None listed
Ports list build and test dependencies as well as runtime dependencies. pkg_add selects those needed for installation.
Direct dependencies
Runtime
Test
- devel/p5-Test-WWW-Mechanize
- www/p5-HTML-TreeBuilder-XPath
- devel/p5-MooseX-Role-Parameterized
- www/p5-WWW-Mechanize
- www/p5-HTML-Tree
Used by (3 dependency relationships)
Includes library, runtime, build and test dependencies.