Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
A bit more information would be helpful.

Under what circumstances are you trying to find ill-formatted HTML tags?

I ask because one case that occurs to me is a situation where you are building or proof-reading raw html on a local machine. If so, using the w3c validator will be easy, free and produce up-to-date results.

Using Perl to use the w3c validator will be more complex (in that case), but it's doable. Write your script to

  1. read your html file into local memory
  2. connect to w3c, send the html page (won't work if merely a fragment, IIRC) to the validator (it accepts a URI, file upload or direct input (cut'n'paste), and capture the return (with one of the usual suspects - search the Monastery for 'web scraping' for one set of ideas).
  3. display the returned errors, warnings, or 'good to go' message for the user or spit'em out to dead trees or whatever.

At a minimum, you can expect standard-based validation this way; Tidy has it's own (configurable within limits) set of notions about valid .html and, as noted above, HTML::Validator may have some outdated notions.


In reply to Re: Modules or rules to find ill-formatted HTML by ww
in thread Modules or rules to find ill-formatted HTML by lihao

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found