Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

[SOLVED] How to get text from site?

by milovidov (Novice)
on Feb 12, 2013 at 01:01 UTC ( #1018272=perlquestion: print w/ replies, xml ) Need Help??
milovidov has asked for the wisdom of the Perl Monks concerning the following question:

Hello all!

Is exist way for getting text from any site? It means that need text from site as can see him visitor of site.

Thanks for your attention!

UPDATE

I found solution simular that offered by grondilu, but with Lynx browser, instead elinks. Because Lynx is a cross-platform solution

Comment on [SOLVED] How to get text from site?
Re: How to get text from site?
by trizen (Hermit) on Feb 12, 2013 at 01:54 UTC
    HTML::Strip may be helpful.
    use strict; use warnings; use encoding qw(UTF-8); use HTML::Strip qw(); use LWP::Simple qw(get); my $url = 'http://example.com'; my $hs = HTML::Strip->new(); my $clean_text = $hs->parse(get($url)); print $clean_text;
Re: How to get text from site?
by grondilu (Pilgrim) on Feb 12, 2013 at 12:25 UTC

    If you want the text to be at least roughly formatted, you can use the '-dump' option of a text-only browser:

    print qx{elinks -dump http://www.perl.org};

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1018272]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2015-07-06 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls