Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: I want to save web pages as text rather than as HTML.

by Anonymous Monk
on Sep 06, 2019 at 17:29 UTC ( #11105733=note: print w/replies, xml ) Need Help??


in reply to I want to save web pages as text rather than as HTML.

You need a true HTML parser to help you get to the particular nodes that you want. Very good write-up here: http://radar.oreilly.com/2014/02/parsing-html-with-perl-2.html
  • Comment on Re: I want to save web pages as text rather than as HTML.

Replies are listed 'Best First'.
Re^2: I want to save web pages as text rather than as HTML.
by anautismobserver (Sexton) on Sep 06, 2019 at 22:14 UTC

    I apologize for my ignorance.

    When I try to run the first "self-contained example" as written in the provided link, it produces no output (except for "Press any key to continue...").

    When I replace the body of the script (starting with "my $re ="...) with the next code example (that uses "HTML::TokeParser::Simple;"), I get the error message "Can't locate HTML::TokeParser::Simple.pm in @INC"

    Could you please give me a code example that truly is self-contained, that reads (and parses) an HTML file and outputs it as a text file?

    Thank you.

      Could you please give me a code example that truly is self-contained, that reads (and parses) an HTML file and outputs it as a text file?

      Sure, go fish, strip HTML tags

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2019-10-22 10:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?