Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: how to force HTML to display as text

by grep (Monsignor)
on Jan 24, 2002 at 12:38 UTC ( [id://141174]=note: print w/replies, xml ) Need Help??


in reply to how to force HTML to display as text

Take a look at HTML::Parser it already does what you want to do. You'll be better off if you don't reinvent this very complicated wheel.

If you really want to do a parser for academic reason I would recommend at least using Parse::RecDescent written by TheDamian this will get you though the tags correctly.

Else you might just be looking for a text based browser like lynx it will run on *nix and M$ Win

As for your post you can use <code> </code> tags to get you spacing and wrapping correct. I also lets other monks DL your code. There are several resources on Perlmonks that can help you out such as turnstep's home node.
Enjoy Perlmonks

UPDATE: as crazyinsomniac pointed out I would be remiss if I did not point out that some searches could have helped out finding some similar nodes like:
  • parsing HTML
  • Dump Text from HTML
    Search is your friend :)
    Some other nodes to read On asking for help and How to ReadTheFineManual

    grep
    grep> cd pub
    grep> more beer
    • Comment on Re: how to force HTML to display as text
  • Log In?
    Username:
    Password:

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

    How do I use this?Last hourOther CB clients
    Other Users?
    Others pondering the Monastery: (None)
      As of 2024-04-19 00:00 GMT
      Sections?
      Information?
      Find Nodes?
      Leftovers?
        Voting Booth?

        No recent polls found