473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DOM comparison utility

Hi all,

Do you know of any tool which can compare the DOM structure of the
content of the web browser?

Specifically, it would be great if there was tool or tools which could:
- Capture the DOM of a website and save it
- Capture the DOM of the website later and save it
- Compare the two DOM structures so you could easily see what's
different about them

Are there such tools? .. I have not found them yet while googling ..
thanks for your help!

- sue yi

Apr 13 '06 #1
7 2049

su****@gmail.com wrote:
Hi all,

Do you know of any tool which can compare the DOM structure of the
content of the web browser?


I haven't read much about this but page 805 of O'Reilly's javascript:
The Definitive Guide 4th ed caught my eye. There is a DOM Level 2
Event's library called MutationEvent. The subheading is "details about
a document change". I don't know if it is well supported in browsers or
if it can do what you want.

Peter

Apr 13 '06 #2
"su****@gmail.com" <su****@gmail.com> writes:
Do you know of any tool which can compare the DOM structure of the
content of the web browser?


Why not compare HTML directly? The DOM structure will match the HTML,
except that some whitespaces might be lost.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Apr 14 '06 #3
The website uses multiple frames ... so viewing the HTML from the main
page shows only framesets and frames, and some of the pages within also
contain framesets.

Apr 14 '06 #4
Lasse Reichstein Nielsen wrote:
"su****@gmail.com" <su****@gmail.com> writes:
Do you know of any tool which can compare the DOM structure
of the content of the web browser?


Why not compare HTML directly? The DOM structure will match
the HTML, except that some whitespaces might be lost.


The DOM structure will only match the mark-up if the mark-up is
sufficiently structurally valid to be directly translated into a DOM
structure. If the receiving browser sees a need to apply
error-correction to the mark-up it receives it is entirely possible that
DOM structure will not reflect the mark-up, and not reflect it in
different ways in different browsers. The crux of the OPs problem may
actually be an attempt to program the scripted interactions with a DOM
resulting from structurally invalid mark-up, with its consequent need to
cope with seemingly random and arbitrary variation in DOM structures
resulting from browser error-correction.

Richard.
Apr 14 '06 #5
su****@gmail.com wrote:
Specifically, it would be great if there was tool or tools which could:
- Capture the DOM of a website and save it
- Capture the DOM of the website later and save it
- Compare the two DOM structures so you could easily see what's
different about them

Are there such tools? .. I have not found them yet while googling ..
thanks for your help!


My ObjectInspector[1] allows for the latter, manually, running in both
browsers which document trees should be compared. I have not thought of
saving the document tree as a file yet, but now that you mention it: yes,
certainly it would be interesting to run a kind of diff on the generated
files, so it is on my To Do list as of now.
PointedEars
___________
[1] <URL:http://pointedears.de/ObjectInspector>
Apr 15 '06 #6
Hi PointedEars,

Your website looks like it could be very useful, but I have not
understood yet how to use it. How do you load a particular web-page to
be loaded into the ObjectInspector?

Btw, I like the UI -- the way you've made the website look just like a
client VB application :)

- sue yi

May 10 '06 #7
su****@gmail.com wrote:
Your website looks like it could be very useful, but I have not
understood yet how to use it. How do you load a particular web-page to
be loaded into the ObjectInspector?
My ObjectInspector (OI) being still alpha, there is an undocumented
feature, ObjectInspector.prototype.include() in objinsp.js (lines 189+),
which includes the OI as an IFrame/ILayer into an HTML document. It takes
two arguments: the URL of the ObjectInspector HTML resource (index.html),
and the options for this OI instance (default: "root=parent").

You can then access the parent window and document through the `parent'
property of `window' (or the Global Object, as specified by the default
options above), provided you access the ObjectInspector from the same
domain or the same second-level domain (for the latter, set
`document.domain' to work around the Same Origin Policy). That is, you
will have to download the index.html and the required script libraries
to your webspace, and link the latter in the former accordingly.

Release 2.0 will be available as a package containing all required files,
that you can download, extract, and use as is. Note that the next Nightly
will be using a CSS-based layout instead of tables, provided I have worked
around all IE's CSS shortcomings by then (I have a CSS-based version on my
local server already that looks fine in Geckos, Operas, and KHTML.)
Btw, I like the UI -- the way you've made the website look just like a
client VB application :)


Looks like I did something wrong then ;-) It is intended to look like the
current GUI as it uses system colors.[1] VB has nothing to do with that.
PointedEars
___________
[1] <URL:http://www.w3.org/TR/CSS2/ui.html#system-colors>
--
Bill Gates isn't the devil -- Satan made sure hell
_worked_ before he opened it to the damned ...
May 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jack | last post by:
I need to compare two files for differences. Does anyone know a good utility for this?
2
by: PengYu.UT | last post by:
I'm wonder whether 1. stl directly defined the 6 comparison operators(== != < > <= >=) directly for iterator and const_iterator 2. or it only define == and < and using std::rel_ops to get the...
6
by: Doug | last post by:
Hello, Can anyone recommend an inexpensive source code comparison utility for .NET. I broke my code an now I need to compare my older version w/ the new one and could use the help of line...
4
by: matt | last post by:
I am trying to compare a two segments of XML from two seperate files. The two XML files are 1)a message pulled from my private Queue and 2)an XML file that is loaded as an XmlDocument object. So...
8
by: Smith | last post by:
I know this question is not much related to this news group. Is there any free utility on the web which campares files in two folders for changes. I wanted to compare two set of .ASPX files?...
43
by: michael.f.ellis | last post by:
The following script puzzles me. It creates two nested lists that compare identically. After identical element assignments, the lists are different. In one case, a single element is replaced. In...
10
by: mickey22 | last post by:
Hi all, I have to perform binary comparison of the generated files each time I build my program. For example in my first build I generate a header file and data file and store them in...
2
by: dudeja.rajat | last post by:
Hi, I looking for a file comparison utility in Python that works like 'diff' command in Unix and 'comp' in Windows. The present 'cmd' in filecmp module only presents output in the form of 1 or...
0
by: Robert Kern | last post by:
dudeja.rajat@gmail.com wrote: There are a couple of ways to do #3. One would be to use the difflib module from the standard library. The Differ.compare() method will give you a sequence of lines...
4
by: Keith | last post by:
Looking for a tool that I can compare like db's on different servers. I.E. I want to compare and see differences in the data on our dev server versus our production servers. Anyone know of a good...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.