This is a little late for OP, probably, but since planetscape has cross-referenced this thread with a more recent one, what follows may still have some value for future readers

.."to determine if they are similar enough to be considered "the same"

There are some great answers, above, but note that some of them touch on what seems to me to be the threshold problem. To be explicit:

What are the criteria for sameness? For one example, are two pages "to be considered the same" if one presents a given data set as a piechart and another as a barchart? ...in tabular fashion rather than as a block of lines?

More generally, are we trying to see if:

  1. the two documents render the same content with mere typographic differences occuring solely because of variant markup? (and what makes those differences "mere?")
  2. the content is different, but the general appearance (layout) is the same or similar? (and for what value of "similar?")

If you sample only segments of the comparatives, how much risk of a false positive are you willing to accept?

Much as I admire the posts above, I think you need to answer these (and similar) questions for your project before adopting a method.


In reply to Re: HTML Document Comparison by ww
in thread HTML Document Comparison by xjar

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.