What are my options for finding the diff between some pretty complicated web pages?

I am trying to see why Server A works when Server B doesn't. Both have the same software on them, and, as far as I can see, the same configuration.

The configuration is stored in an LDAP database, and is presented in an administration console written in Java Server Faces.

The best approaches I can think of are

  • use a tool for generating images of the entirity of each page and then do a visual diff
  • use traditional vanilla text diff
  • doing an XSL diff similar to this SO question

Obviously I am only really interested in the contents of the HTML fields, so I am wondering if there are any tools that are HTML aware that can do the diffing for me? A plugin for Firefox would be even better to save me having to save each page by hand.

I can't use an online diff tool because the two servers are on an intranet.

ps: I know: no wonder the server doesn't work, it's using Java Server Faces - sadly I don't have much choice about that.

link|improve this question

63% accept rate
I'm not sure this is appropriate for SuperUser. I'm also not sure if it belongs on Stack Overflow (doing it programatically?) or Pro Webmasters. (Or even Server Fault? Nah, probably not.) – Shinrai May 11 '11 at 14:44
I wasn't sure where to put it either. I decided that since it wasn't web design and associated it wasn't for Pro Webmasters, and since the solution wasn't necessarily a programming solution, it wasn't SO either; it's not an admin problem as such, so it's not Server Fault, so Superuser seemed best because it seemed the best place to get the "Yes, Project X" will do, or "No, you'll need to code that yourself" type of answer I'm after. – Rich May 11 '11 at 15:22
Yeah, this is a pretty ambiguous one. Unfortunately it's also a really good question so I hope somebody SOMEPLACE knows. – Shinrai May 11 '11 at 15:31
feedback

1 Answer

The obvious approach is one you have already identified.

  • Get the same page from the two servers using a tool such as wget or curl.
  • Use a text diff to examine the differences.
  • If one page has superfluous differences that you wish to ignore, use an appropriate tool to canonicalise (in a general sense) the data.
  • If necessary, use the same techniques to get and compare references such as external Javascript and CSS.
link|improve this answer
+1 probably the only viable approach. To canonicalize the pages, you probably want to use some scripting language + an HTML parser. Just search for "html parser" on stackoverflow.com, you'll get many hits. – sleske Jun 6 '11 at 10:35
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.