John
21-11-2004, 08:06
Is there an utility that dump the document information of the current HTML page into a tree like structure?
|
View Full Version : Is there a HTML document dump utility? John 21-11-2004, 08:06 Is there an utility that dump the document information of the current HTML page into a tree like structure? JoeP 21-11-2004, 09:01 Well, If you use Save As from IE that will create an HTML document on your local hard disc with the images, ec. in directories. There are various XML utilities that would probably be configurable to parse XML in to a tree and then allow further processing - the MSXML library that Microsoft produce would do it. What format do you want the tree in? Joe mr.blaze 21-11-2004, 12:13 Black Widow Web Ripper does exactly what you want. John 21-11-2004, 12:51 Neither of them is what I am after. I need a dump of the DOM of the current processed website. would be formatted something like (syntax won't be extact) document .....forms[0]->name: Logon ..........object[0] ...............type:field ...............name:username ...............value:John ...............etc.... ..........object[1] ...............type:field ...............name:password ...............value:XYZ ...............etc..... .....forms[1]=>name:Search ..........etc... .....image[0]..... etc... I want to be able to quickly write references like... username = document.forms['logon'].object['username'].value; It must be possible to write a Javascript code to "walk" the DOM structure and dump the output. Is there such utility out there? JoeP 21-11-2004, 13:35 Aha! Understand. Have you tried looking to see if there's a Perl script that does it? There are a few Perl libraries that are used for screen scraping that might help. www.cpan.org Otherwise I guess you'll just need to write your own code.... Joe John 21-11-2004, 16:44 I eventually found something. <script id="jsDebugger" language="JavaScript" src="http://www.bitesizeinc.net/demo/jsDebugger/jsDebugger.js"></script> <body onLoad="jsDebuggerDisplay()"> Place this on your webpage and it will open up a DOM viewer. More info found Here (http://www.bitesizeinc.net/node/view/8043/30#30) JoeP 21-11-2004, 18:27 Oooh....now that looks useful! Thanks for posting - will take a look! Joe John 21-11-2004, 23:48 I solved my referencing problem more or less within 5 minutes after looking through that nifty DOM viewer. I do not know the structure of DOM so this is going to save me many hours when I use it as a last resort. :clap: JoeP 22-11-2004, 07:50 My current development work has me involved with DOM and XML in Visual BASIC up to my armpits. It's not too bad when you get used to it, but this utility looks most useful! Joe ncrossland 22-11-2004, 08:55 The DOM inspector does something similar in Firefox. You can select an element and it shows you all its properties, and makes it flash red in your browser to highlight it. Phanerothyme 22-11-2004, 09:24 Yeah I was going to say, you can view the whole DOM tree for any page open in Firefox by hitting Shift + Ctrl + I John 22-11-2004, 21:56 Thanks for the Firefox info - I'm converted! :thumbsup: |