Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Module to extract text from HTML

by marto (Cardinal)
on Feb 27, 2024 at 11:29 UTC ( [id://11157918]=note: print w/replies, xml ) Need Help??


in reply to Module to extract text from HTML

Mojo::DOM (via Mojo::UserAgent):

use strict; use warnings; use feature 'say'; use Mojo::UserAgent; my $ua = Mojo::UserAgent->new; say $ua->get('https://www.perlmonks.org')->res->dom->all_text;

WWW::Mechanize:

use strict; use warnings; use feature 'say'; use WWW::Mechanize; my $ua = WWW::Mechanize->new; $ua->get('https://perlmonks.org'); say $ua->content(format => 'text');

Replies are listed 'Best First'.
Re^2: Module to extract text from HTML
by Bod (Parson) on Feb 27, 2024 at 19:37 UTC

    Thanks

    The Mojo::UserAgent solution looks like it could be just what I am looking for 👍

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11157918]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-20 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found