Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
There's more than one way to do things
 
PerlMonks  

html parser.

by Punto (Scribe)
on Mar 19, 2001 at 01:25 UTC ( [id://65338]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

Punto has asked for the wisdom of the Perl Monks concerning the following question:

Hi.

I'm writing this cgi script, and I'm putting 'class' and 'id' attributes on all HTML tags so we can then use Style Sheets to modify the style of the HTML (don't like the designers touching my code. :)
What I need to do now is generate a list of all the tags, clases and ids available on the HTML code, to use on the css files.

So, is there a simple HTML parser that I can use to do this? I don't need any complicated 'XML' thing.

Thanks.

Replies are listed 'Best First'.
Re: html parser.
by Masem (Monsignor) on Mar 19, 2001 at 02:16 UTC
    There's HTML::Parser, which will tree-ify your HTML document, which you can transverse to find what you need.
    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://65338]
Approved by root
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.