Web::S...LibXML(3pm)

πŸ“¦
version 0.38 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Web::Scraper::LibXML β€” bestie, it's a drop-in replacement for Web::Scraper so you can use LibXML πŸ’–


🌸 SYNOPSIS 🌸

okay so literally just swap the import and you're done:

use Web::Scraper::LibXML;

# same as Web::Scraper
my $scraper = scraper { ... };

no cap, that's it. same as Web::Scraper fr fr 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so Web::Scraper::LibXML is a drop-in replacement for Web::Scraper, and its whole thing is that it uses the fast libxml-based HTML tree builder, aka HTML::TreeBuilder::LibXML. she's fast. she's iconic. πŸ‘‘

this module is almost identical to HTML::TreeBuilder::LibXML's replace_original installer, which looks like this:

use HTML::TreeBuilder::LibXML;
HTML::TreeBuilder::LibXML->replace_original();

use Web::Scraper;
my $scraper = scraper { ... };
# this code uses LibXML parser

and what that installer does is it overrides HTML::TreeBuilder::XPath's new() constructor, so that ALL of your code using HTML::TreeBuilder::XPath gets switched over to the libxml based parser. all of it. every single bit. no exceptions, periodt. πŸ’…

ngl that's a whole lot of power and zero chill β€” it just takes over everything.

This module, instead, gives you more control over which TreeBuilder to use, depending on the site etc. so you can vibe-check per-site instead of letting one installer make decisions for your entire codebase. main character energy but responsible 🧚


πŸ‘‘ SEE ALSO πŸ‘‘

  • Web::Scraper
  • HTML::TreeBuilder::LibXML

and that's the whole page, bestie πŸŽ€ this was written for perl v5.34.0, dated 2022-06-28, straight out of the User Contributed Perl Documentation. go forth and scrape slayfully πŸ’œβœ¨

πŸ“¦ where this page comes from